Skip to content

Commit 7750f49

Browse files
authored
DOC: fix docstring validation errors for pandas.core.window (#59634)
* DOCS: pandas.core.window SA01 docstring validation error fixed * DOC: pandas.core.window SA01 docstring validation error linting fixes * DOC: pandas.core.window.rolling.Window.var PR01 docstring validation fix
1 parent 5285ff8 commit 7750f49

File tree

3 files changed

+31
-5
lines changed

3 files changed

+31
-5
lines changed

ci/code_checks.sh

-5
Original file line numberDiff line numberDiff line change
@@ -229,11 +229,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
229229
-i "pandas.core.resample.Resampler.sum SA01" \
230230
-i "pandas.core.resample.Resampler.transform PR01,RT03,SA01" \
231231
-i "pandas.core.resample.Resampler.var SA01" \
232-
-i "pandas.core.window.expanding.Expanding.corr PR01" \
233-
-i "pandas.core.window.expanding.Expanding.count PR01" \
234-
-i "pandas.core.window.rolling.Rolling.max PR01" \
235-
-i "pandas.core.window.rolling.Window.std PR01" \
236-
-i "pandas.core.window.rolling.Window.var PR01" \
237232
-i "pandas.date_range RT03" \
238233
-i "pandas.errors.AbstractMethodError PR01,SA01" \
239234
-i "pandas.errors.AttributeConflictWarning SA01" \

pandas/core/window/expanding.py

+5
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,8 @@ def aggregate(self, func, *args, **kwargs):
174174

175175
@doc(
176176
template_header,
177+
create_section_header("Parameters"),
178+
kwargs_numeric_only,
177179
create_section_header("Returns"),
178180
template_returns,
179181
create_section_header("See Also"),
@@ -865,6 +867,9 @@ def cov(
865867
output will be a MultiIndexed DataFrame in the case of DataFrame
866868
inputs. In the case of missing elements, only complete pairwise
867869
observations will be used.
870+
ddof : int, default 1
871+
Delta Degrees of Freedom. The divisor used in calculations
872+
is ``N - ddof``, where ``N`` represents the number of elements.\n
868873
"""
869874
).replace("\n", "", 1),
870875
kwargs_numeric_only,

pandas/core/window/rolling.py

+26
Original file line numberDiff line numberDiff line change
@@ -1350,6 +1350,13 @@ def mean(self, numeric_only: bool = False, **kwargs):
13501350
@doc(
13511351
template_header,
13521352
create_section_header("Parameters"),
1353+
dedent(
1354+
"""
1355+
ddof : int, default 1
1356+
Delta Degrees of Freedom. The divisor used in calculations
1357+
is ``N - ddof``, where ``N`` represents the number of elements.
1358+
"""
1359+
).replace("\n", "", 1),
13531360
kwargs_numeric_only,
13541361
kwargs_scipy,
13551362
create_section_header("Returns"),
@@ -1392,6 +1399,13 @@ def var(self, ddof: int = 1, numeric_only: bool = False, **kwargs):
13921399
@doc(
13931400
template_header,
13941401
create_section_header("Parameters"),
1402+
dedent(
1403+
"""
1404+
ddof : int, default 1
1405+
Delta Degrees of Freedom. The divisor used in calculations
1406+
is ``N - ddof``, where ``N`` represents the number of elements.
1407+
"""
1408+
).replace("\n", "", 1),
13951409
kwargs_numeric_only,
13961410
kwargs_scipy,
13971411
create_section_header("Returns"),
@@ -2099,7 +2113,19 @@ def sum(
20992113
template_header,
21002114
create_section_header("Parameters"),
21012115
kwargs_numeric_only,
2116+
dedent(
2117+
"""
2118+
*args : iterable, optional
2119+
Positional arguments passed into ``func``.\n
2120+
"""
2121+
).replace("\n", "", 1),
21022122
window_agg_numba_parameters(),
2123+
dedent(
2124+
"""
2125+
**kwargs : mapping, optional
2126+
A dictionary of keyword arguments passed into ``func``.\n
2127+
"""
2128+
).replace("\n", "", 1),
21032129
create_section_header("Returns"),
21042130
template_returns,
21052131
create_section_header("See Also"),

0 commit comments

Comments
 (0)