diff --git a/ci/code_checks.sh b/ci/code_checks.sh index 51edc218cc2bd..1f9ada185f9a3 100755 --- a/ci/code_checks.sh +++ b/ci/code_checks.sh @@ -231,6 +231,10 @@ if [[ -z "$CHECK" || "$CHECK" == "doctests" ]]; then -k"-_set_axis_name -_xs -describe -droplevel -groupby -interpolate -pct_change -pipe -reindex -reindex_axis -to_json -transpose -values -xs -to_clipboard" RET=$(($RET + $?)) ; echo $MSG "DONE" + MSG='Doctests groupby.py' ; echo $MSG + pytest -q --doctest-modules pandas/core/groupby/groupby.py -k"-cumcount -describe -pipe" + RET=$(($RET + $?)) ; echo $MSG "DONE" + MSG='Doctests top-level reshaping functions' ; echo $MSG pytest -q --doctest-modules \ pandas/core/reshape/concat.py \ diff --git a/pandas/core/groupby/groupby.py b/pandas/core/groupby/groupby.py index bd8a8852964e3..2eb9171668d35 100644 --- a/pandas/core/groupby/groupby.py +++ b/pandas/core/groupby/groupby.py @@ -1117,7 +1117,6 @@ def mean(self, *args, **kwargs): each group. >>> df.groupby('A').mean() - >>> B C A 1 3.0 1.333333 @@ -1126,7 +1125,6 @@ def mean(self, *args, **kwargs): Groupby two columns and return the mean of the remaining column. >>> df.groupby(['A', 'B']).mean() - >>> C A B 1 2.0 2 @@ -1138,7 +1136,6 @@ def mean(self, *args, **kwargs): the group. >>> df.groupby('A')['B'].mean() - >>> A 1 3.0 2 4.0 @@ -2145,7 +2142,7 @@ def head(self, n=5): -------- >>> df = pd.DataFrame([[1, 2], [1, 4], [5, 6]], - columns=['A', 'B']) + ... columns=['A', 'B']) >>> df.groupby('A', as_index=False).head(1) A B 0 1 2 @@ -2172,7 +2169,7 @@ def tail(self, n=5): -------- >>> df = pd.DataFrame([['a', 1], ['a', 2], ['b', 1], ['b', 2]], - columns=['A', 'B']) + ... columns=['A', 'B']) >>> df.groupby('A').tail(1) A B 1 a 2