Skip to content

DOC: correct examples for Resample a time series for clarity #58947

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ Aggregate the current hourly time series values to the monthly maximum value in

.. ipython:: python

monthly_max = no_2.resample("ME").max()
monthly_max = no_2.resample("MS").max()
monthly_max

A very powerful method on time series data with a datetime index, is the
Expand Down
4 changes: 2 additions & 2 deletions doc/source/user_guide/timeseries.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1864,15 +1864,15 @@ to resample based on datetimelike column in the frame, it can passed to the
),
)
df
df.resample("ME", on="date")[["a"]].sum()
df.resample("MS", on="date")[["a"]].sum()

Similarly, if you instead want to resample by a datetimelike
level of ``MultiIndex``, its name or location can be passed to the
``level`` keyword.

.. ipython:: python

df.resample("ME", level="d")[["a"]].sum()
df.resample("MS", level="d")[["a"]].sum()

.. _timeseries.iterating-label:

Expand Down
Loading