Skip to content

DOC: Fix Examples section for some window methods #40208

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
merged 3 commits into from
Mar 5, 2021
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
2 changes: 1 addition & 1 deletion pandas/core/window/doc.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def create_section_header(header: str) -> str:

numba_notes = (
"See :ref:`window.numba_engine` for extended documentation "
"and performance considerations for the Numba engine.\n"
"and performance considerations for the Numba engine.\n\n"
)

window_agg_numba_parameters = dedent(
Expand Down
14 changes: 7 additions & 7 deletions pandas/core/window/expanding.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ def apply(
create_section_header("See Also"),
template_see_also,
create_section_header("Notes"),
numba_notes,
numba_notes[:-1],
window_method="expanding",
aggregation_description="sum",
agg_method="sum",
Expand All @@ -215,7 +215,7 @@ def sum(self, *args, engine=None, engine_kwargs=None, **kwargs):
create_section_header("See Also"),
template_see_also,
create_section_header("Notes"),
numba_notes,
numba_notes[:-1],
window_method="expanding",
aggregation_description="maximum",
agg_method="max",
Expand All @@ -235,7 +235,7 @@ def max(self, *args, engine=None, engine_kwargs=None, **kwargs):
create_section_header("See Also"),
template_see_also,
create_section_header("Notes"),
numba_notes,
numba_notes[:-1],
window_method="expanding",
aggregation_description="minimum",
agg_method="min",
Expand All @@ -255,7 +255,7 @@ def min(self, *args, engine=None, engine_kwargs=None, **kwargs):
create_section_header("See Also"),
template_see_also,
create_section_header("Notes"),
numba_notes,
numba_notes[:-1],
window_method="expanding",
aggregation_description="mean",
agg_method="mean",
Expand All @@ -274,7 +274,7 @@ def mean(self, *args, engine=None, engine_kwargs=None, **kwargs):
create_section_header("See Also"),
template_see_also,
create_section_header("Notes"),
numba_notes,
numba_notes[:-1],
window_method="expanding",
aggregation_description="median",
agg_method="median",
Expand Down Expand Up @@ -399,7 +399,7 @@ def var(self, ddof: int = 1, *args, **kwargs):
create_section_header("See Also"),
template_see_also,
create_section_header("Notes"),
"A minimum of one period is required for the calculation.\n",
"A minimum of one period is required for the calculation.\n\n",
create_section_header("Examples"),
dedent(
"""
Expand Down Expand Up @@ -448,7 +448,7 @@ def skew(self, **kwargs):
"scipy.stats.kurtosis : Reference SciPy method.\n",
template_see_also,
create_section_header("Notes"),
"A minimum of four periods is required for the calculation.\n",
"A minimum of four periods is required for the calculation.\n\n",
create_section_header("Examples"),
dedent(
"""
Expand Down
12 changes: 6 additions & 6 deletions pandas/core/window/rolling.py
Original file line number Diff line number Diff line change
Expand Up @@ -1656,7 +1656,7 @@ def sum(self, *args, engine=None, engine_kwargs=None, **kwargs):
create_section_header("See Also"),
template_see_also,
create_section_header("Notes"),
numba_notes,
numba_notes[:-1],
window_method="rolling",
aggregation_description="maximum",
agg_method="max",
Expand Down Expand Up @@ -1798,7 +1798,7 @@ def median(self, engine=None, engine_kwargs=None, **kwargs):
The default ``ddof`` of 1 used in :meth:`Series.std` is different
than the default ``ddof`` of 0 in :func:`numpy.std`.

A minimum of one period is required for the rolling calculation.
A minimum of one period is required for the rolling calculation.\n
"""
).replace("\n", "", 1),
create_section_header("Examples"),
Expand Down Expand Up @@ -1847,7 +1847,7 @@ def std(self, ddof=1, *args, **kwargs):
The default ``ddof`` of 1 used in :meth:`Series.var` is different
than the default ``ddof`` of 0 in :func:`numpy.var`.

A minimum of one period is required for the rolling calculation.
A minimum of one period is required for the rolling calculation.\n
"""
).replace("\n", "", 1),
create_section_header("Examples"),
Expand Down Expand Up @@ -1908,7 +1908,7 @@ def skew(self, **kwargs):
create_section_header("See Also"),
template_see_also,
create_section_header("Notes"),
"A minimum of one period is required for the calculation.\n",
"A minimum of one period is required for the calculation.\n\n",
create_section_header("Examples"),
dedent(
"""
Expand Down Expand Up @@ -1938,7 +1938,7 @@ def sem(self, ddof=1, *args, **kwargs):
"scipy.stats.kurtosis : Reference SciPy method.\n",
template_see_also,
create_section_header("Notes"),
"A minimum of four periods is required for the calculation.\n",
"A minimum of four periods is required for the calculation.\n\n",
create_section_header("Examples"),
dedent(
"""
Expand Down Expand Up @@ -2106,7 +2106,7 @@ def cov(self, other=None, pairwise=None, ddof=1, **kwargs):
columns on the second level.

In the case of missing elements, only complete pairwise observations
will be used.
will be used.\n
"""
).replace("\n", "", 1),
create_section_header("Examples"),
Expand Down