Skip to content

UofT-DSI | Python - Assignment 2#2

Open
brianna-lowe wants to merge 2 commits intomainfrom
assignment-2
Open

UofT-DSI | Python - Assignment 2#2
brianna-lowe wants to merge 2 commits intomainfrom
assignment-2

Conversation

@brianna-lowe
Copy link
Owner

UofT-DSI | Python - Assignment 2

What changes are you trying to make? (e.g. Adding or removing code, refactoring existing code, adding reports)

I implemented the full patient inflammation analysis workflow for Assignment 2. This includes loading and inspecting CSV data, adding a loop to print rows for inspection, building the patient_summary() function to compute mean, max, or min inflammation per patient, and developing the detect_problems() function to check for zero-mean patient values using the provided check_zeros() helper. I also corrected issues such as indentation errors and a misspelled NumPy keyword.

What did you learn from the changes you have made?

Through these updates, I learned how to use NumPy operations along specific axes, how to structure functions that accept dynamic parameters, and how to interpret and resolve common Python errors such as TypeErrors and indentation problems. I also gained practice integrating multiple functions together to create a small analysis pipeline.

Was there another approach you were thinking about making? If so, what approach(es) were you thinking of?

I considered creating separate helper functions for each summary operation (e.g., mean_summary(), max_summary()), but ultimately kept the logic inside a single patient_summary() to reduce repetition and simplify the API. I also briefly considered adding file validation steps but focused on meeting the assignment requirements.

Were there any challenges? If so, what issue(s) did you face? How did you overcome it?

Yes, I initially encountered issues with indentation, which caused certain blocks of logic to become unreachable, and with a misspelled keyword (axi instead of axis) that produced a NumPy TypeError. I resolved these issues by reviewing error messages carefully, checking NumPy documentation, and verifying code structure step-by-step.

How were these changes tested?

I tested the functions by loading the inflammation dataset and confirming the expected array shape, validating that summary outputs from patient_summary() had the correct length (60 patients), and running each operation type (mean, max, min). I also tested detect_problems() across several CSV files to confirm correct detection of zero-mean patients. All assignment-provided tests passed successfully.

A reference to a related issue in your repository (if applicable)

N/A

Checklist

  • [ YES ] I can confirm that my changes are working as intended

Copy link

@efantinatti efantinatti left a comment

Choose a reason for hiding this comment

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

Hi @brianna-lowe Q1 is OK but Q2 can be tested with the other scenarios for max and mean. Q3 you also can consider to test all files and see which one you'll find the True value.

@brianna-lowe
Copy link
Owner Author

@efantinatti Based on your feedback, I have upated section 2 & 3

Copy link

@efantinatti efantinatti left a comment

Choose a reason for hiding this comment

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

Hi @brianna-lowe Q1 is ok, however Q2 you may consider printing the contents for min, max, mean and other parameter different of these three, so we can see the outputs performing accordingly. Q3 you may consider scanning the files to find the ones with the True values.

Best
@efantinatti

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments