Skip to content

Commit c681254

Browse files
committed
Updated docstring, added whatsnew
1 parent c1c6e40 commit c681254

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

doc/source/whatsnew/v1.1.0.rst

+1
Original file line numberDiff line numberDiff line change
@@ -721,6 +721,7 @@ Groupby/resample/rolling
721721
- Bug in :meth:`DataFrame.groupby` where a ``ValueError`` would be raised when grouping by a categorical column with read-only categories and ``sort=False`` (:issue:`33410`)
722722
- Bug in :meth:`GroupBy.first` and :meth:`GroupBy.last` where None is not preserved in object dtype (:issue:`32800`)
723723
- Bug in :meth:`Rolling.min` and :meth:`Rolling.max`: Growing memory usage after multiple calls when using a fixed window (:issue:`30726`)
724+
- Bug in :meth:`DataFrame.groupby` when using ``as_index=False`` would modify the grouping column when used with ``idxmax``, ``idxmin``, ``mad``, ``nunique``, and ``skew`` (:issue:`21090`)
724725

725726
Reshaping
726727
^^^^^^^^^

pandas/core/groupby/generic.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -1846,11 +1846,11 @@ def nunique(self, dropna: bool = True):
18461846
5 ham 5 y
18471847
18481848
>>> df.groupby('id').nunique()
1849-
id value1 value2
1849+
value1 value2
18501850
id
1851-
egg 1 1 1
1852-
ham 1 1 2
1853-
spam 1 2 1
1851+
egg 1 1
1852+
ham 1 2
1853+
spam 2 1
18541854
18551855
Check for rows with the same id but conflicting values:
18561856

pandas/tests/groupby/test_function.py

+1
Original file line numberDiff line numberDiff line change
@@ -585,6 +585,7 @@ def test_ops_general(op, targop):
585585

586586

587587
def test_ops_not_as_index(reduction_func):
588+
# GH 21090
588589
# Using as_index=False should not modify grouped column
589590

590591
if reduction_func in ("corrwith",):

0 commit comments

Comments
 (0)