The Step Tracker Report

Data with PythonMedium+20 XP+20

The Step Tracker Report

A group of friends compare their daily step counts. Their tracker app exports a grid of counts, but there are two versions of the app, and they lay the same table out differently:

rows_areeach row is…each column is…
"people"one personone day
"days"one dayone person

Task: write step_report(steps, rows_are) returning a tuple (day_means, person_bests):

  • day_means — the average count on each day: one value per day, in day order, rounded to 4 decimal places,
  • person_bests — each person's highest single-day count: one value per person, in person order.

Return both as plain lists. Whichever way the table arrives, the answer for the same friends on the same days is the same.

Example

Ana and Ben over three days: three day averages, two personal bests.

Examples

steps = [[4000, 9000, 6500], [8000, 3000, 7000]]
rows_are = "people"
returns ([6000.0, 6000.0, 6750.0], [9000, 8000])
steps = [[4000, 8000], [9000, 3000], [6500, 7000]]
rows_are = "days"
returns ([6000.0, 6000.0, 6750.0], [9000, 8000])

Hints

Solve it to unlock the solution

Once your code passes every test, a reference solution shows up here so you can compare it with yours.

solution.py
CtrlEnterto run