Module 2 Activity: Summarize Practice Minutes with NumPy
Estimated active time: 60-75 minutes
Task
Create a NumPy array that represents practice minutes for four learners across five days.
Starter data
practice = [
[30, 45, 50, 40, 60],
[10, 20, 15, 0, 25],
[55, 60, 65, 70, 75],
[20, 0, 30, 35, 40],
]
Steps
- Convert the list to a NumPy array.
- Print shape, ndim, size, and dtype.
- Select the first learner.
- Select day 3 for every learner.
- Create a mask for practice minutes greater than or equal to 45.
- Add 5 minutes to every value using vectorized operation.
- Calculate the mean for each learner.
- Calculate the mean for each day.
- Use a random seed to simulate 20 quiz scores.
- Write three sentences explaining what you learned.
Deliverable
- NumPy practice notebook or worksheet.
- Axis explanation note.
- Simulation output with seed.
Quality bar
The activity is ready when the learner can explain the difference between overall mean, learner mean, and day mean.
