Skip to content

Commit 0d47e86

Browse files
authored
DOC: correct examples for Resample a time series for clarity (#58947)
update documentation for resample a time series to another frequency
1 parent 0e90f66 commit 0d47e86

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

doc/source/getting_started/intro_tutorials/09_timeseries.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ Aggregate the current hourly time series values to the monthly maximum value in
295295

296296
.. ipython:: python
297297
298-
monthly_max = no_2.resample("ME").max()
298+
monthly_max = no_2.resample("MS").max()
299299
monthly_max
300300
301301
A very powerful method on time series data with a datetime index, is the

doc/source/user_guide/timeseries.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -1864,15 +1864,15 @@ to resample based on datetimelike column in the frame, it can passed to the
18641864
),
18651865
)
18661866
df
1867-
df.resample("ME", on="date")[["a"]].sum()
1867+
df.resample("MS", on="date")[["a"]].sum()
18681868
18691869
Similarly, if you instead want to resample by a datetimelike
18701870
level of ``MultiIndex``, its name or location can be passed to the
18711871
``level`` keyword.
18721872

18731873
.. ipython:: python
18741874
1875-
df.resample("ME", level="d")[["a"]].sum()
1875+
df.resample("MS", level="d")[["a"]].sum()
18761876
18771877
.. _timeseries.iterating-label:
18781878

0 commit comments

Comments
 (0)