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
Copy file name to clipboardExpand all lines: doc/source/whatsnew/v0.21.0.txt
+39
Original file line number
Diff line number
Diff line change
@@ -14,6 +14,8 @@ Highlights include:
14
14
categoricals independent of the data, see :ref:`here <whatsnew_0210.enhancements.categorical_dtype>`.
15
15
- The behavior of ``sum`` and ``prod`` on all-NaN Series/DataFrames is now consistent and no longer depends on whether `bottleneck <http://berkeleyanalytics.com/bottleneck>`__ is installed, see :ref:`here <whatsnew_0210.api_breaking.bottleneck>`
16
16
- Compatibility fixes for pypy, see :ref:`here <whatsnew_0210.pypy>`.
17
+
- ``GroupBy`` objects now have a ``pipe`` method, similar to the one on ``DataFrame`` and ``Series``,
18
+
that allow for functions that take a ``GroupBy`` to be composed in a clean, readable syntax.
17
19
18
20
Check the :ref:`API Changes <whatsnew_0210.api_breaking>` and :ref:`deprecations <whatsnew_0210.deprecations>` before updating.
19
21
@@ -202,6 +204,43 @@ still the string ``'category'``. We'll take this moment to remind users that the
202
204
203
205
See the :ref:`CategoricalDtype docs <categorical.categoricaldtype>` for more.
204
206
207
+
.. _whatsnew_0210.enhancements.GroupBy.pipe:
208
+
209
+
``GroupBy`` objects now have a ``pipe`` method
210
+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
211
+
212
+
``GroupBy`` objects now have a ``pipe`` method, similar to the one on
213
+
``DataFrame`` and ``Series``, that allow for functions that take a
214
+
``GroupBy`` to be composed in a clean, readable syntax. (:issue:`17871`)
215
+
216
+
For a concrete example on combining ``.groupby`` and ``.pipe`` , imagine having a
217
+
DataFrame with columns for stores, products, revenue and sold quantity. We'd like to
218
+
do a groupwise calculation of *prices* (i.e. revenue/quantity per store and per product).
219
+
We could do this in a multi-step operation, but expressing it in terms of piping can make the
0 commit comments