# Tutorial CS-4: A messy watch export to a clean table

Take 693 activity summaries in a watch's own field names and units, audit every unit with an identity, write the cleaning rules first, keep a change log, and produce a quarterly running summary a coach can trust.

Address: https://apopt.com/data/tutorials/cs04-messy-watch-export/  
License: CC BY 4.0  
Prepared: 2026-12-03

## Description

Files for the tutorial *A messy watch export to a clean table* (https://apopt.com/course/tutorials/cs04-messy-watch-export/). `raw/` holds the inputs as the device or app wrote them; `clean/` holds the cleaned copies the tutorial writes; `expected/` holds what a correct run prints and saves, so you can check your own run.

## Files

| file | size | rows | description |
|---|---|---|---|
| [clean/activities_categorized.csv](https://apopt.com/data/tutorials/cs04-messy-watch-export/clean/activities_categorized.csv) | 118.4 KB | 693 rows | Cleaned copy written by the tutorial |
| [clean/change_log.csv](https://apopt.com/data/tutorials/cs04-messy-watch-export/clean/change_log.csv) | 223 B | 7 rows | Cleaned copy written by the tutorial |
| [clean/quarter_summary.csv](https://apopt.com/data/tutorials/cs04-messy-watch-export/clean/quarter_summary.csv) | 647 B | 11 rows | Cleaned copy written by the tutorial |
| [expected/printed-output.txt](https://apopt.com/data/tutorials/cs04-messy-watch-export/expected/printed-output.txt) | 5.4 KB |  | Everything the tutorial prints, cell by cell |
| [raw/activities_clean.csv](https://apopt.com/data/tutorials/cs04-messy-watch-export/raw/activities_clean.csv) | 92.0 KB | 693 rows | the case file's own conversion of the same activities to SI units with local start times, for checking your conversion |
| [raw/sessions_fit.csv](https://apopt.com/data/tutorials/cs04-messy-watch-export/raw/sessions_fit.csv) | 114.5 KB | 693 rows | 693 activity summaries, 28 June 2024 to 28 November 2026, one watch; the FIT session fields with the watch's own names and units |

Large files are stated with their size. A `preview.md` in this folder shows the first rows of each table.

## Columns

| column | unit | meaning |
|---|---|---|
| activity_id | text | row id (local start time and sport) |
| start_time | ISO 8601 | start in UTC (the "Z") |
| utc_offset_h | h | local clock minus UTC at the start |
| sport / sub_sport | text | sport and sub-sport as the watch labels them |
| total_timer_time | s | moving time (the timer stops on pauses) |
| total_elapsed_time | s | clock time from start to stop (pauses included) |
| total_distance | m | distance (wrist accelerometer on indoor runs) |
| enhanced_avg_speed / enhanced_max_speed | m/s | average (over timer time) and maximum speed |
| avg_running_cadence | strides/min (×2 for steps/min) | cadence of ONE foot on runs |
| avg_cadence | pedal rpm (bike); strokes/min (swim); undefined elsewhere | cadence on other sports |
| total_strides | count | strides of one foot |
| avg_step_length | mm | distance per step |
| avg_stance_time | ms | ground-contact time |
| avg_vertical_oscillation | mm | vertical bounce of the torso |
| avg_vertical_ratio | % | oscillation ÷ step length |
| avg_power | W | running power the watch estimates |
| avg_heart_rate / max_heart_rate | beats/min | heart rate (optical at the wrist) |
| total_ascent | m | climb (barometer) |
| total_calories | kcal | energy estimate |

## Provenance

- Source: COROS Training Hub archive of FIT activity files (session summaries only), from the course case file athletes/jh/coros-history
- Removed: every GPS position and all per-second records; the archive's activity ids and file names; device serial and account identifiers
- Permission basis: The athlete publishes his own data with the course
- Prepared with: dda/tutorials/build.py

## Used in

- Book: [Chapter 4: Athlete Data in Python](https://apopt.com/book/ch04-python/)
- Course: [Week 4 lesson](https://apopt.com/course/week/4/)
- Homework H08: [https://apopt.com/course/assess/h08/](https://apopt.com/course/assess/h08/)
- Homework H09: [https://apopt.com/course/assess/h09/](https://apopt.com/course/assess/h09/)

## How to cite

Tutorial CS-4: A messy watch export to a clean table. IRSRI Sports Research Institute, 2026. Data-Driven Athletics data repository. https://apopt.com/data/tutorials/cs04-messy-watch-export/

## Load it

```python
import pandas as pd
df = pd.read_csv("https://apopt.com/data/tutorials/cs04-messy-watch-export/raw/activities_clean.csv")
```
