You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using :meth:`DataFrame.groupby` with ``as_index=True`` and the aggregation ``nunique`` would include the grouping column(s) in the columns of the result. Now the grouping column(s) only appear in the index, consistent with other reductions. (:issue:`32579`)
Using :meth:`DataFrame.groupby` with ``as_index=False`` and the function ``idxmax``, ``idxmin``, ``mad``, ``nunique``, ``sem``, ``skew``, or ``std`` would modify the grouping column. Now the grouping column remains unchanged, consistent with other reductions. (:issue:`21090`, :issue:`10355`)
616
+
617
+
*Previous behavior*:
618
+
619
+
.. code-block:: ipython
620
+
621
+
In [3]: df.groupby("a", as_index=False).nunique()
622
+
Out[4]:
623
+
a b
624
+
0 1 1
625
+
1 1 2
626
+
627
+
*New behavior*:
628
+
629
+
.. ipython:: python
630
+
631
+
df.groupby("a", as_index=False).nunique()
632
+
586
633
.. _whatsnew_110.deprecations:
587
634
588
635
Deprecations
@@ -855,7 +902,6 @@ Groupby/resample/rolling
855
902
- Bug in :meth:`Series.groupby` would raise ``ValueError`` when grouping by :class:`PeriodIndex` level (:issue:`34010`)
856
903
- Bug in :meth:`GroupBy.agg`, :meth:`GroupBy.transform`, and :meth:`GroupBy.resample` where subclasses are not preserved (:issue:`28330`)
857
904
- Bug in :meth:`GroupBy.rolling.apply` ignores args and kwargs parameters (:issue:`33433`)
858
-
- Bug in :meth:`DataFrameGroupby.std` and :meth:`DataFrameGroupby.sem` would modify grouped-by columns when ``as_index=False`` (:issue:`10355`)
0 commit comments