The question
Describe current-week activity in steps and minutes; do not mix in the previous week.
df Measurement profileYour inputs
df
steps is a count; minutes is duration. Missing measurements are unknown, not zero.
Field meanings and units
record_id- Activity-observation identifier.
group- Comparison group.
date- Calendar date supplied as YYYY-MM-DD text unless the task states it is invalid.
steps- Recorded step count, additive across observations.
minutes- Elapsed duration in minutes; unknown is not zero.
week- Current or Previous reporting week.
record_id | group | date | steps | minutes | week |
|---|---|---|---|---|---|
| A001 | Morning | 2026-04-01 | 2500 | 20 | Previous |
| A002 | Evening | 2026-04-09 | 3070 | 27 | Current |
| A003 | Morning | 2026-04-10 | 3640 | 34 | Current |
| A004 | Evening | 2026-04-04 | 4210 | 41 | Previous |
| A005 | Morning | 2026-04-12 | 4780 | None | Current |
View all 16 rows
record_id | group | date | steps | minutes | week |
|---|---|---|---|---|---|
| A001 | Morning | 2026-04-01 | 2500 | 20 | Previous |
| A002 | Evening | 2026-04-09 | 3070 | 27 | Current |
| A003 | Morning | 2026-04-10 | 3640 | 34 | Current |
| A004 | Evening | 2026-04-04 | 4210 | 41 | Previous |
| A005 | Morning | 2026-04-12 | 4780 | None | Current |
| A006 | Evening | 2026-04-13 | 5350 | 55 | Current |
| A007 | Morning | 2026-04-07 | 5920 | 21 | Previous |
| A008 | Evening | 2026-04-08 | 2640 | 28 | Current |
| A009 | Morning | 2026-04-09 | 3210 | 35 | Current |
| A010 | Evening | 2026-04-03 | 3780 | 42 | Previous |
| A011 | Morning | 2026-04-11 | 4350 | 49 | Current |
| A012 | Evening | 2026-04-12 | 4920 | 56 | Current |
| A013 | Morning | 2026-04-06 | 5490 | 22 | Previous |
| A014 | Evening | 2026-04-14 | 6060 | 29 | Current |
| A015 | Morning | 2026-04-08 | 2780 | 36 | Current |
| A016 | Evening | 2026-04-02 | 3350 | 43 | Previous |
The editable setup in Your Python creates these inputs when you run it.
Describe current-week activity in steps and minutes; do not mix in the previous week.
summaryDataFrameknownSeriesDeliverables
Make the outputs listed below. Use each name exactly as shown. Then choose Check answer.
Python name key
Teal outlines name table columns. Violet left rules name Python objects. Dotted rules mark syntax, functions and parameters. Use each name exactly as shown.
Words in this task
- missing
- no value was supplied
- Current-week summaryOutput
summaryDataFrame- Use the Current-
weekstepsandminutescolumns to createsummarywith their standard descriptive statistics (describe()). - Each column should ignore its own missing values.
- Use the Current-
- Known measurementsOutput
knownSeries- Store the count of
knownvalues forstepsandminutesinknown.
- Store the count of
Data policy Keep all supplied source tables unchanged. Work on separate outputs.
Help Hints & explained solution
Choose the amount of help you need. Opening one hint does not reveal the others.
Hint 1 — Think
A row may have one measurement without the other. How should that appear in a summary?
Hint 2 — Tools
describe(), count() and selection
Revisit: Describe numeric columns · Find missing values · Combine conditions · Answer one numerical question
Hint 3 — Approach
Select current-week measurements, summarise each numeric column and count the observations available for each.
Explained solution
Add these lines below # Your work in the editor. The supplied input setup is already there.
current = df.loc[df.week == 'Current', ['steps', 'minutes']]
summary = current.describe()
known = current.count()
summaryView supplied setup
This code is already at the top of the editor.
import pandas as pd
# Supplied input: df (16 rows)
df = pd.DataFrame(
[
('A001', 'Morning', '2026-04-01', 2500, 20, 'Previous'),
('A002', 'Evening', '2026-04-09', 3070, 27, 'Current'),
('A003', 'Morning', '2026-04-10', 3640, 34, 'Current'),
('A004', 'Evening', '2026-04-04', 4210, 41, 'Previous'),
('A005', 'Morning', '2026-04-12', 4780, None, 'Current'),
('A006', 'Evening', '2026-04-13', 5350, 55, 'Current'),
('A007', 'Morning', '2026-04-07', 5920, 21, 'Previous'),
('A008', 'Evening', '2026-04-08', 2640, 28, 'Current'),
('A009', 'Morning', '2026-04-09', 3210, 35, 'Current'),
('A010', 'Evening', '2026-04-03', 3780, 42, 'Previous'),
('A011', 'Morning', '2026-04-11', 4350, 49, 'Current'),
('A012', 'Evening', '2026-04-12', 4920, 56, 'Current'),
('A013', 'Morning', '2026-04-06', 5490, 22, 'Previous'),
('A014', 'Evening', '2026-04-14', 6060, 29, 'Current'),
('A015', 'Morning', '2026-04-08', 2780, 36, 'Current'),
('A016', 'Evening', '2026-04-02', 3350, 43, 'Previous'),
],
columns=['record_id', 'group', 'date', 'steps', 'minutes', 'week'],
)Why these steps exist
- Each column has its own observed count; an unknown duration does not invalidate a known step count.
- The 50% row is the median. The standard deviation summarises variation in the observed sample.
Another valid approach
Selecting columns before or after the population filter is equivalent here. Keep the summary limited to the requested measures.