Skip to content

Commit b2056ca

Browse files
committed
DOC: clean up aggregations docs, removing from whatsnew
1 parent b4dfbc5 commit b2056ca

File tree

1 file changed

+4
-58
lines changed

1 file changed

+4
-58
lines changed

doc/source/whatsnew/v0.18.0.txt

+4-58
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,7 @@ You could also specify a ``how`` directly
420420
2010-01-01 09:00:06 6.249881 6.097384 6.331650 6.124518
421421
2010-01-01 09:00:08 5.104699 5.343172 5.732009 8.069486
422422

423-
Assignment operations will raise a ``ValueError``:
423+
However, getting and assignment operations directly on a ``Resampler`` will raise a ``ValueError``:
424424

425425
.. code-block:: python
426426

@@ -517,63 +517,6 @@ New API
517517

518518
In the new API, you can either downsample OR upsample. The prior implementation would allow you to pass an aggregator function (like ``mean``) even though you were upsampling, providing a bit of confusion.
519519

520-
.. _whatsnew_0180.breaking.aggregation:
521-
522-
Aggregation API clarifictions
523-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
524-
525-
As part of the new API for :ref:`window functions <whatsnew_0180.enhancements.moments>` and :ref:`resampling <whatsnew_0180.resample>`, aggregation functions have been
526-
clarified. (:issue:`9052`). A full set of examples are presented in :ref:`groupby <groupby.aggregation>`.
527-
528-
Here are the available methodologies and changes for these aggregations.
529-
530-
.. ipython:: python
531-
532-
df = pd.DataFrame({'A': ['foo', 'bar', 'foo', 'bar',
533-
'foo', 'bar', 'foo', 'foo'],
534-
'B': ['one', 'one', 'two', 'three',
535-
'two', 'two', 'one', 'three'],
536-
'C': np.random.randn(8),
537-
'D': np.arange(8)})
538-
539-
grouped = df.groupby(['A', 'B'])
540-
541-
Passing a single function or a list of aggregation functions
542-
543-
.. ipython:: python
544-
545-
grouped[['D','C']].agg(['sum','mean'])
546-
547-
548-
Passing a single level dictionary will perform aggregations and name
549-
the result columns as the keys.
550-
551-
.. ipython:: python
552-
553-
grouped['D'].agg({'result1': np.sum,
554-
'result2': np.mean})
555-
556-
You can also pass a single level dictionary where the keys are the column names.
557-
558-
.. ipython:: python
559-
560-
grouped.agg({'C': 'sum', 'D': 'std'})
561-
562-
Finally you can pass a nested dictionary to enable specific functions on specific
563-
columns and have renaming.
564-
565-
.. ipython:: python
566-
567-
grouped.agg({'C': {'summer': 'sum'}, 'D' : {'stddev':'std'}})
568-
569-
The change in 0.18.0 is to disallow the following, which could be ambiguous,
570-
and will now raise a ``SpecificationError``.
571-
572-
.. code-block:: python
573-
574-
grouped.agg({'summer': {'C': 'sum'}, 'stddev' : {'D':'std'}})
575-
576-
577520
Changes to eval
578521
^^^^^^^^^^^^^^^
579522

@@ -657,6 +600,9 @@ Other API Changes
657600

658601
- ``DataFrame.unstack`` and ``Series.unstack`` now take ``fill_value`` keyword to allow direct replacement of missing values when an unstack results in missing values in the resulting ``DataFrame``. As an added benefit, specifying ``fill_value`` will preserve the data type of the original stacked data. (:issue:`9746`)
659602

603+
- As part of the new API for :ref:`window functions <whatsnew_0180.enhancements.moments>` and :ref:`resampling <whatsnew_0180.resample>`, aggregation functions have been
604+
clarified, raising more informative error messages on invalid aggregations. (:issue:`9052`). A full set of examples are presented in :ref:`groupby <groupby.aggregation>`.
605+
660606
.. _whatsnew_0180.deprecations:
661607

662608
Deprecations

0 commit comments

Comments
 (0)