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.
What changes are you trying to make? (e.g. Adding or removing code, refactoring existing code, adding reports)
Adding code to complete Assignment 2. This includes reading and displaying data from the first CSV file, creating the
patient_summary()function to calculate mean, maximum, and minimum inflammation values for each patient, and creating thedetect_problems()function to identify whether any patients have a mean inflammation score of 0.What did you learn from the changes you have made?
I learned how to read CSV files in Python using both basic file handling and NumPy. I also learned how to write reusable functions, apply summary operations across rows of a dataset, and use helper functions to detect possible data issues. In addition, I improved my understanding of array operations and how to debug common Python errors such as indentation problems and variable naming issues.
Was there another approach you were thinking about making? If so, what approach(es) were you thinking of?
One other approach I considered was using only basic Python with loops and lists for all calculations instead of using NumPy. However, NumPy was a better choice because it made the code shorter, clearer, and more efficient for calculating row-based statistics like mean, max, and min.
Were there any challenges? If so, what issue(s) did you face? How did you overcome it?
One challenge was fixing an indentation error caused by inconsistent spacing in Python. Another issue was a
NameErrorcaused by returning a variable name that had not been defined. I overcame these issues by carefully checking the indentation in each code block and making sure that the returned variable name matched the one used inside the function.How were these changes tested?
The changes were tested by running the functions on the first inflammation CSV file. I verified that
patient_summary(all_paths[0], 'min')returned an output of length 60, which matched the expected number of patients. I also tested the logic of thedetect_problems()function by confirming that it correctly usedpatient_summary()together withcheck_zeros().A reference to a related issue in your repository (if applicable)
N/A
Checklist