Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Assignment Day 2 _9th December 2020.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
{
"data": {
"text/plain": [
"'Mary had a little lamb'"
"'Mary had a little lamb and also a girl with her'"

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: Ensure that the updated string content does not impact any downstream analysis or output expectations within the notebook. If the string's content is used in examples, demonstrations, or tests further in the notebook, verify that these sections are reviewed and updated as necessary to reflect the change.
Code Suggestion:

No specific code change suggested, but a review of dependent cells is recommended.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Performance Issue: The change in the string to include 'and also a girl with her' increases the length of the data being processed. This modification, while seemingly minor, can have implications on memory usage and potentially on the execution time, especially if this string manipulation is part of a larger, more complex data processing operation or if it's executed multiple times within a loop.
Fix: Evaluate the necessity of the string modification. If the added information is crucial, consider optimizing the string storage or processing methods. For example, if this operation is within a loop or a frequently called function, ensure that the string manipulation is optimized for performance. This could involve using more efficient string handling techniques or ensuring that the operation is only performed when absolutely necessary.
Code Suggestion:

Evaluate the necessity of the string modification. If crucial, optimize string handling:

- Before modification:
  text = 'Mary had a little lamb'

- After modification, if necessary:
  text = 'Mary had a little lamb and also a girl with her'
  # Ensure optimization for memory and performance, especially within loops or frequent calls.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: Update the text output to include both 'Mary had a little lamb' and 'a girl with her' for clarity and completeness.
Code Suggestion:

{
  "line": "+       \"'Mary had a little lamb and also a girl with her\"",
  "ol": null,
  "ul": 27
}

]
},
"execution_count": 6,
Expand Down