Skip to content

Commit 77b03bd

Browse files
authored
DOC: Fixed examples in pandas/core/aggregation.py (#33263)
1 parent 65c1044 commit 77b03bd

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

ci/code_checks.sh

+4
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,10 @@ if [[ -z "$CHECK" || "$CHECK" == "doctests" ]]; then
272272
pytest -q --doctest-modules pandas/core/accessor.py
273273
RET=$(($RET + $?)) ; echo $MSG "DONE"
274274

275+
MSG='Doctests aggregation.py' ; echo $MSG
276+
pytest -q --doctest-modules pandas/core/aggregation.py
277+
RET=$(($RET + $?)) ; echo $MSG "DONE"
278+
275279
MSG='Doctests base.py' ; echo $MSG
276280
pytest -q --doctest-modules pandas/core/base.py
277281
RET=$(($RET + $?)) ; echo $MSG "DONE"

pandas/core/aggregation.py

+4-5
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,9 @@ def is_multi_agg_with_relabel(**kwargs) -> bool:
2727
2828
Examples
2929
--------
30-
>>> is_multi_agg_with_relabel(a='max')
30+
>>> is_multi_agg_with_relabel(a="max")
3131
False
32-
>>> is_multi_agg_with_relabel(a_max=('a', 'max'),
33-
... a_min=('a', 'min'))
32+
>>> is_multi_agg_with_relabel(a_max=("a", "max"), a_min=("a", "min"))
3433
True
3534
>>> is_multi_agg_with_relabel()
3635
False
@@ -61,8 +60,8 @@ def normalize_keyword_aggregation(kwargs: dict) -> Tuple[dict, List[str], List[i
6160
6261
Examples
6362
--------
64-
>>> normalize_keyword_aggregation({'output': ('input', 'sum')})
65-
({'input': ['sum']}, ('output',), [('input', 'sum')])
63+
>>> normalize_keyword_aggregation({"output": ("input", "sum")})
64+
(defaultdict(<class 'list'>, {'input': ['sum']}), ('output',), array([0]))
6665
"""
6766
# Normalize the aggregation functions as Mapping[column, List[func]],
6867
# process normally, then fixup the names.

0 commit comments

Comments
 (0)