Annual aggregation summarizes observations into one value for each calendar year. For cycling traffic, summing hourly pedal-cycle counts by location ID and year produces a compact series for comparing long-term change while removing hourly noise. section 9.2.1
Annual cycling counts by location
Group traffic records by Count_point_id and Year, sum Pedal_cycles, and reset the index. The result has one row per location-year, ready for trend comparisons or later calculations of absolute and percentage change. section 9.2.1
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
traffic = pd.read_parquet("./data/time_series.parquet.gz")
cycling = (
traffic
.groupby(["Count_point_id", "Year"])
["Pedal_cycles"]
.sum()
.reset_index()
)
cycling.head()
This pandas workflow reads the prepared traffic data and creates annual pedal-cycle totals for every location. section 9.2.1
Inspect the aggregated distribution before selecting locations: many locations may have little or no cycling traffic, so histograms and quartiles help choose a defensible cutoff. section 9.2.1
