Skip to content

Commit 6409754

Browse files
authored
DOC: Fix Examples section for some window methods (#40208)
1 parent c5695c8 commit 6409754

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

pandas/core/window/doc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ def create_section_header(header: str) -> str:
9595

9696
numba_notes = (
9797
"See :ref:`window.numba_engine` for extended documentation "
98-
"and performance considerations for the Numba engine.\n"
98+
"and performance considerations for the Numba engine.\n\n"
9999
)
100100

101101
window_agg_numba_parameters = dedent(

pandas/core/window/expanding.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ def apply(
195195
create_section_header("See Also"),
196196
template_see_also,
197197
create_section_header("Notes"),
198-
numba_notes,
198+
numba_notes[:-1],
199199
window_method="expanding",
200200
aggregation_description="sum",
201201
agg_method="sum",
@@ -215,7 +215,7 @@ def sum(self, *args, engine=None, engine_kwargs=None, **kwargs):
215215
create_section_header("See Also"),
216216
template_see_also,
217217
create_section_header("Notes"),
218-
numba_notes,
218+
numba_notes[:-1],
219219
window_method="expanding",
220220
aggregation_description="maximum",
221221
agg_method="max",
@@ -235,7 +235,7 @@ def max(self, *args, engine=None, engine_kwargs=None, **kwargs):
235235
create_section_header("See Also"),
236236
template_see_also,
237237
create_section_header("Notes"),
238-
numba_notes,
238+
numba_notes[:-1],
239239
window_method="expanding",
240240
aggregation_description="minimum",
241241
agg_method="min",
@@ -255,7 +255,7 @@ def min(self, *args, engine=None, engine_kwargs=None, **kwargs):
255255
create_section_header("See Also"),
256256
template_see_also,
257257
create_section_header("Notes"),
258-
numba_notes,
258+
numba_notes[:-1],
259259
window_method="expanding",
260260
aggregation_description="mean",
261261
agg_method="mean",
@@ -274,7 +274,7 @@ def mean(self, *args, engine=None, engine_kwargs=None, **kwargs):
274274
create_section_header("See Also"),
275275
template_see_also,
276276
create_section_header("Notes"),
277-
numba_notes,
277+
numba_notes[:-1],
278278
window_method="expanding",
279279
aggregation_description="median",
280280
agg_method="median",
@@ -399,7 +399,7 @@ def var(self, ddof: int = 1, *args, **kwargs):
399399
create_section_header("See Also"),
400400
template_see_also,
401401
create_section_header("Notes"),
402-
"A minimum of one period is required for the calculation.\n",
402+
"A minimum of one period is required for the calculation.\n\n",
403403
create_section_header("Examples"),
404404
dedent(
405405
"""
@@ -448,7 +448,7 @@ def skew(self, **kwargs):
448448
"scipy.stats.kurtosis : Reference SciPy method.\n",
449449
template_see_also,
450450
create_section_header("Notes"),
451-
"A minimum of four periods is required for the calculation.\n",
451+
"A minimum of four periods is required for the calculation.\n\n",
452452
create_section_header("Examples"),
453453
dedent(
454454
"""

pandas/core/window/rolling.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1656,7 +1656,7 @@ def sum(self, *args, engine=None, engine_kwargs=None, **kwargs):
16561656
create_section_header("See Also"),
16571657
template_see_also,
16581658
create_section_header("Notes"),
1659-
numba_notes,
1659+
numba_notes[:-1],
16601660
window_method="rolling",
16611661
aggregation_description="maximum",
16621662
agg_method="max",
@@ -1798,7 +1798,7 @@ def median(self, engine=None, engine_kwargs=None, **kwargs):
17981798
The default ``ddof`` of 1 used in :meth:`Series.std` is different
17991799
than the default ``ddof`` of 0 in :func:`numpy.std`.
18001800
1801-
A minimum of one period is required for the rolling calculation.
1801+
A minimum of one period is required for the rolling calculation.\n
18021802
"""
18031803
).replace("\n", "", 1),
18041804
create_section_header("Examples"),
@@ -1847,7 +1847,7 @@ def std(self, ddof=1, *args, **kwargs):
18471847
The default ``ddof`` of 1 used in :meth:`Series.var` is different
18481848
than the default ``ddof`` of 0 in :func:`numpy.var`.
18491849
1850-
A minimum of one period is required for the rolling calculation.
1850+
A minimum of one period is required for the rolling calculation.\n
18511851
"""
18521852
).replace("\n", "", 1),
18531853
create_section_header("Examples"),
@@ -1908,7 +1908,7 @@ def skew(self, **kwargs):
19081908
create_section_header("See Also"),
19091909
template_see_also,
19101910
create_section_header("Notes"),
1911-
"A minimum of one period is required for the calculation.\n",
1911+
"A minimum of one period is required for the calculation.\n\n",
19121912
create_section_header("Examples"),
19131913
dedent(
19141914
"""
@@ -1938,7 +1938,7 @@ def sem(self, ddof=1, *args, **kwargs):
19381938
"scipy.stats.kurtosis : Reference SciPy method.\n",
19391939
template_see_also,
19401940
create_section_header("Notes"),
1941-
"A minimum of four periods is required for the calculation.\n",
1941+
"A minimum of four periods is required for the calculation.\n\n",
19421942
create_section_header("Examples"),
19431943
dedent(
19441944
"""
@@ -2106,7 +2106,7 @@ def cov(self, other=None, pairwise=None, ddof=1, **kwargs):
21062106
columns on the second level.
21072107
21082108
In the case of missing elements, only complete pairwise observations
2109-
will be used.
2109+
will be used.\n
21102110
"""
21112111
).replace("\n", "", 1),
21122112
create_section_header("Examples"),

0 commit comments

Comments
 (0)