Tsallaka zuwa abun ciki
Justice Tech School

resample

resample groups time series into periods such as months.

Example
s = pd.Series(range(6), index=pd.date_range("2026-01-01", periods=6, freq="15D"))
print(s.resample("MS").sum())

Result

2026-01-01    3
2026-02-01    3
2026-03-01    9
Freq: MS, dtype: int64

Exercise

Monthly totals.

s.("MS").sum()

Quiz Test

What does resample need?

These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.