Skip to content

Assignment 2#3

Open
HaochongYANG wants to merge 2 commits intomainfrom
assignment-2
Open

Assignment 2#3
HaochongYANG wants to merge 2 commits intomainfrom
assignment-2

Conversation

@HaochongYANG
Copy link
Copy Markdown
Owner

TITLE: UofT-DSI | Python - Assignment 2

What changes are you trying to make?

I completed assignment_2.ipynb for Assignment 2. Specifically, I:

  • added code to read and print the contents of the first inflammation data file,
  • implemented patient_summary(file_path, operation) to compute patient-level summary statistics (mean, max, and min),
  • implemented detect_problems(file_path) to identify whether any patient has a mean inflammation score of 0.

What did you learn from the changes you have made?

I learned how to load and summarize CSV data with NumPy, how to write simple reusable functions, and how to use helper functions to build a small data-checking workflow.

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

I considered writing separate functions for each summary statistic, but I decided to use one function with an operation argument because it is simpler and avoids repeating code.

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

The main challenge was making sure the summaries were computed across the correct axis so that the output returned one value per patient. I addressed this by checking the shape of the dataset and confirming that each row corresponds to one patient.

How were these changes tested?

I tested the notebook by running all cells and checking that:

  • the first data file printed correctly,
  • patient_summary(all_paths[0], 'min') returned an array of length 60,
  • detect_problems(all_paths[0]) produced the expected boolean output,
  • the notebook executed without errors from top to bottom.

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

N/A

Checklist

  • I can confirm that my changes are working as intended

Copy link
Copy Markdown

@Dmytro-Bonislavskyi Dmytro-Bonislavskyi left a comment

Choose a reason for hiding this comment

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

Approved

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