Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
UofT-DSI | Python - Assignment 2
What changes are you trying to make? (e.g. Adding or removing code, refactoring existing code, adding reports)
In this assignment, I needed to read and display data from an inflammation CSV file corresponding to patient data. I also needed to create a function 'patient summary' that could compute statistics like mean, max and min. Lastly, I needed to develop a function 'detect_problems' which would identify a mean inflammation score of 0 and return a True or False value.
What did you learn from the changes you have made?
I learned how to implement file handling and data reading methods using readlines(). I also learned how to use numpy mean, max and min functions on a specific row (axis). Lastly, I learned how to develop a function and implement a return command.
Was there another approach you were thinking about making? If so, what approach(es) were you thinking of?
For Part 2, I used axis = 1 into each operation of mean, max and min. I could have just referenced axis = ax so that if I had to change ax = 1 in the beginning, I could just change the value instead of having to go through each operation line and changing it manually.
Were there any challenges? If so, what issue(s) did you face? How did you overcome it?
I had an error message in Part 2 where numpy was not installed into the environment so troubleshooting that was a little tricky. With some trial and error I figured out that I could use 'uv sync' to resolve the issue. I also had a lot of syntax errors along the way like forgetting the colon after defining a function or not properly indenting my return command which would throw an error message.
How were these changes tested?
I ran the code to see if it aligned with the values expected in assignment 2 and ensured there were no errors. For example, in Part 2 having the output as 60 and in Part 3 having the output as False.
A reference to a related issue in your repository (if applicable)
Checklist