Skip to content

Commit 5e3a965

Browse files
FIX: Small tweaks in docs
Co-authored-by: Tiago Firmino <[email protected]>
1 parent 8ae0caf commit 5e3a965

File tree

2 files changed

+83
-18
lines changed

2 files changed

+83
-18
lines changed

pandas/core/resample.py

Lines changed: 82 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1005,7 +1005,6 @@ def asfreq(self, fill_value=None):
10051005
return self._upsample("asfreq", fill_value=fill_value)
10061006

10071007
@final
1008-
@doc(GroupBy.sum)
10091008
def sum(
10101009
self,
10111010
numeric_only: bool = False,
@@ -1030,6 +1029,24 @@ def sum(
10301029
The required number of valid values to perform the operation. If fewer
10311030
than ``min_count`` non-NA values are present the result will be NA.
10321031
1032+
skipna : bool, default True
1033+
Exclude NA/null values when computing the result.
1034+
1035+
engine : str, default None
1036+
* ``'cython'`` : Runs rolling apply through C-extensions from cython.
1037+
* ``'numba'`` : Runs rolling apply through JIT compiled code from numba.
1038+
Only available when ``raw`` is set to ``True``.
1039+
* ``None`` : Defaults to ``'cython'``
1040+
or globally setting ``compute.use_numba``
1041+
1042+
engine_kwargs : dict, default None
1043+
* For ``'cython'`` engine, there are no accepted ``engine_kwargs``
1044+
* For ``'numba'`` engine, the engine can accept ``nopython``, ``nogil``
1045+
and ``parallel`` dictionary keys. The values must either be ``True`` or
1046+
``False``. The default ``engine_kwargs`` for the ``'numba'`` engine is
1047+
``{{'nopython': True, 'nogil': False, 'parallel': False}}`` and will be
1048+
applied to both the ``func`` and the ``apply`` groupby aggregation.
1049+
10331050
Returns
10341051
-------
10351052
Series or DataFrame
@@ -1064,7 +1081,6 @@ def sum(
10641081
)
10651082

10661083
@final
1067-
@doc(GroupBy.prod)
10681084
def prod(self, numeric_only: bool = False, min_count: int = 0, skipna: bool = True):
10691085
"""
10701086
Compute prod of group values.
@@ -1082,6 +1098,9 @@ def prod(self, numeric_only: bool = False, min_count: int = 0, skipna: bool = Tr
10821098
The required number of valid values to perform the operation. If fewer
10831099
than ``min_count`` non-NA values are present the result will be NA.
10841100
1101+
skipna : bool, default True
1102+
Exclude NA/null values when computing the result.
1103+
10851104
Returns
10861105
-------
10871106
Series or DataFrame
@@ -1111,7 +1130,6 @@ def prod(self, numeric_only: bool = False, min_count: int = 0, skipna: bool = Tr
11111130
)
11121131

11131132
@final
1114-
@doc(GroupBy.min)
11151133
def min(
11161134
self,
11171135
numeric_only: bool = False,
@@ -1156,7 +1174,6 @@ def min(
11561174
)
11571175

11581176
@final
1159-
@doc(GroupBy.max)
11601177
def max(
11611178
self,
11621179
numeric_only: bool = False,
@@ -1234,17 +1251,6 @@ def median(
12341251
return self._downsample("median", numeric_only=numeric_only, skipna=skipna)
12351252

12361253
@final
1237-
@doc(GroupBy.any)
1238-
def any(self, skipna: bool = True):
1239-
return self._downsample("any", skipna=skipna)
1240-
1241-
@final
1242-
@doc(GroupBy.all)
1243-
def all(self, skipna: bool = True):
1244-
return self._downsample("all", skipna=skipna)
1245-
1246-
@final
1247-
@doc(GroupBy.mean)
12481254
def mean(
12491255
self,
12501256
numeric_only: bool = False,
@@ -1264,6 +1270,26 @@ def mean(
12641270
12651271
numeric_only now defaults to ``False``.
12661272
1273+
skipna : bool, default True
1274+
Exclude NA/null values when computing the result.
1275+
1276+
engine : str, default None
1277+
* ``'cython'`` : Runs the operation through C-extensions from cython.
1278+
* ``'numba'`` : Runs the operation through JIT compiled code from numba.
1279+
* ``None`` : Defaults to ``'cython'`` or globally setting
1280+
``compute.use_numba``
1281+
1282+
.. versionadded:: 1.4.0
1283+
1284+
engine_kwargs : dict, default None
1285+
* For ``'cython'`` engine, there are no accepted ``engine_kwargs``
1286+
* For ``'numba'`` engine, the engine can accept ``nopython``, ``nogil``
1287+
and ``parallel`` dictionary keys. The values must either be ``True`` or
1288+
``False``. The default ``engine_kwargs`` for the ``'numba'`` engine is
1289+
``{{'nopython': True, 'nogil': False, 'parallel': False}}``
1290+
1291+
.. versionadded:: 1.4.0
1292+
12671293
Returns
12681294
-------
12691295
DataFrame or Series
@@ -1298,7 +1324,6 @@ def mean(
12981324
)
12991325

13001326
@final
1301-
@doc(GroupBy.std)
13021327
def std(
13031328
self,
13041329
ddof: int = 1,
@@ -1314,6 +1339,24 @@ def std(
13141339
----------
13151340
ddof : int, default 1
13161341
Degrees of freedom.
1342+
1343+
engine : str, default None
1344+
* ``'cython'`` : Runs the operation through C-extensions from cython.
1345+
* ``'numba'`` : Runs the operation through JIT compiled code from numba.
1346+
* ``None`` : Defaults to ``'cython'`` or globally setting
1347+
``compute.use_numba``
1348+
1349+
.. versionadded:: 1.4.0
1350+
1351+
engine_kwargs : dict, default None
1352+
* For ``'cython'`` engine, there are no accepted ``engine_kwargs``
1353+
* For ``'numba'`` engine, the engine can accept ``nopython``, ``nogil``
1354+
and ``parallel`` dictionary keys. The values must either be ``True`` or
1355+
``False``. The default ``engine_kwargs`` for the ``'numba'`` engine is
1356+
``{{'nopython': True, 'nogil': False, 'parallel': False}}``
1357+
1358+
.. versionadded:: 1.4.0
1359+
13171360
numeric_only : bool, default False
13181361
Include only `float`, `int` or `boolean` data.
13191362
@@ -1323,6 +1366,9 @@ def std(
13231366
13241367
numeric_only now defaults to ``False``.
13251368
1369+
skipna : bool, default True
1370+
Exclude NA/null values when computing the result.
1371+
13261372
Returns
13271373
-------
13281374
DataFrame or Series
@@ -1359,7 +1405,6 @@ def std(
13591405
)
13601406

13611407
@final
1362-
@doc(GroupBy.var)
13631408
def var(
13641409
self,
13651410
ddof: int = 1,
@@ -1376,6 +1421,23 @@ def var(
13761421
ddof : int, default 1
13771422
Degrees of freedom.
13781423
1424+
engine : str, default None
1425+
* ``'cython'`` : Runs the operation through C-extensions from cython.
1426+
* ``'numba'`` : Runs the operation through JIT compiled code from numba.
1427+
* ``None`` : Defaults to ``'cython'`` or globally setting
1428+
``compute.use_numba``
1429+
1430+
.. versionadded:: 1.4.0
1431+
1432+
engine_kwargs : dict, default None
1433+
* For ``'cython'`` engine, there are no accepted ``engine_kwargs``
1434+
* For ``'numba'`` engine, the engine can accept ``nopython``, ``nogil``
1435+
and ``parallel`` dictionary keys. The values must either be ``True`` or
1436+
``False``. The default ``engine_kwargs`` for the ``'numba'`` engine is
1437+
``{{'nopython': True, 'nogil': False, 'parallel': False}}``
1438+
1439+
.. versionadded:: 1.4.0
1440+
13791441
numeric_only : bool, default False
13801442
Include only `float`, `int` or `boolean` data.
13811443
@@ -1385,6 +1447,9 @@ def var(
13851447
13861448
numeric_only now defaults to ``False``.
13871449
1450+
skipna : bool, default True
1451+
Exclude NA/null values when computing the result.
1452+
13881453
Returns
13891454
-------
13901455
DataFrame or Series

pandas/tests/groupby/test_reductions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1087,7 +1087,7 @@ def scipy_sem(*args, **kwargs):
10871087
("median", ["f", "t", "td"]),
10881088
("prod", ["f"]),
10891089
("sem", ["f"]),
1090-
("std", ["f", "t", "td"]),
1090+
("std", ["f"]),
10911091
("var", ["f"]),
10921092
("any", ["f"]),
10931093
("all", ["f"]),

0 commit comments

Comments
 (0)