Study
Pandas · Time series
DatetimeIndex, date_range, the .dt accessor, resampling to weekly or monthly, rolling windows and shift.
- resample is groupby for time: it buckets rows into periods like weeks or months.
- rolling(7).mean() smooths noise; shift(1) lines today up with yesterday.