Skip to content

Assignment 2#2

Open
ahilkhuwaja wants to merge 7 commits intomainfrom
assignment-2
Open

Assignment 2#2
ahilkhuwaja wants to merge 7 commits intomainfrom
assignment-2

Conversation

@ahilkhuwaja
Copy link
Copy Markdown
Owner

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

Added code for assignment 2

What did you learn from the changes you have made?

All the concepts covered in Week 2 of python - for and while loops, different functions and methods i.e: readlines, etc

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

N/A

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

Thinking through how to implement the logic through python. Code itself wasn't the tough part

How were these changes tested?

Through using the testers provided and using print statements to check code was executing as expected

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
Copy Markdown

@xindizhang xindizhang left a comment

Choose a reason for hiding this comment

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

Change Request: Part 2

Your implementation works well and shows a solid grasp of loops and NumPy basics — great job on that. Now, think about whether you really need to loop through the data manually. NumPy offers built-in functions that work efficiently across axes, which can help clean up your code and remove hardcoded values like 60.

Can you think of a way to replace the loop with a single NumPy operation that works across each patient row, no matter how many rows are in the dataset?

@ahilkhuwaja
Copy link
Copy Markdown
Owner Author

Hi Xindi, thanks for pointing out the mistake. I have corrected the mistake in P2 and made it much more efficient using the np array to calculate the operations. I've tested the changes and pushed the updated changes to Github. Please let me know if I need to do anything further. Thanks!

Used this block of code:
summary_values = data.function_name(axis=1)

Copy link
Copy Markdown

@xindizhang xindizhang left a comment

Choose a reason for hiding this comment

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

Thank you for the update and note! Great work — no further changes needed!

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