Skip to content

DOC: fix groupby.rst building errors #14861 #14863

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

Closed
wants to merge 1 commit into from
Closed
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
16 changes: 8 additions & 8 deletions doc/source/groupby.rst
Original file line number Diff line number Diff line change
Expand Up @@ -631,11 +631,11 @@ the column B based on the groups of column A.

.. ipython:: python

df = pd.DataFrame({'A': [1] * 10 + [5] * 10,
df_re = pd.DataFrame({'A': [1] * 10 + [5] * 10,
'B': np.arange(20)})
df
df.groupby('A').rolling(4).B.mean()
df_re

df_re.groupby('A').rolling(4).B.mean()


The ``expanding()`` method will accumulate a given operation
Expand All @@ -644,7 +644,7 @@ group.

.. ipython:: python

df.groupby('A').expanding().sum()
df_re.groupby('A').expanding().sum()


Suppose you want to use the ``resample()`` method to get a daily
Expand All @@ -653,14 +653,14 @@ missing values with the ``ffill()`` method.

.. ipython:: python

df = pd.DataFrame({'date': pd.date_range(start='2016-01-01',
df_re = pd.DataFrame({'date': pd.date_range(start='2016-01-01',
periods=4,
freq='W'),
'group': [1, 1, 2, 2],
'val': [5, 6, 7, 8]}).set_index('date')
df
df_re

df.groupby('group').resample('1D').ffill()
df_re.groupby('group').resample('1D').ffill()

.. _groupby.filter:

Expand Down