|
| 1 | +:orphan: |
| 2 | + |
| 3 | +Supported Aggregation Functions |
| 4 | +==================================== |
| 5 | + |
| 6 | +This page lists which aggregation functions are supported by ``DataFrame.agg``, |
| 7 | +``Series.agg``, ``DataFrameGroupBy.agg``, and ``SeriesGroupBy.agg``. |
| 8 | +The following table is structured as follows: The first column contains the aggregation function's name. |
| 9 | +The second column is a flag for whether or not the aggregation is supported by ``DataFrame.agg``. The |
| 10 | +third column is a flag for whether or not the aggregation is supported by ``Series.agg``. The fourth column |
| 11 | +is whether or not the aggregation is supported by ``DataFrameGroupBy.agg``. The fifth column is whether or not |
| 12 | +the aggregation is supported by ``SeriesGroupBy.agg``. |
| 13 | + |
| 14 | +.. note:: |
| 15 | + ``Y`` stands for yes (supports distributed implementation), ``N`` stands for no (API simply errors out), |
| 16 | + and ``P`` stands for partial (meaning some parameters may not be supported yet). |
| 17 | + |
| 18 | + Both Python builtin and NumPy functions are supported for ``DataFrameGroupBy.agg`` and ``SeriesGroupBy.agg``. |
| 19 | + |
| 20 | ++-----------------------------+-------------------------------------+----------------------------------+--------------------------------------------+-----------------------------------------+ |
| 21 | +| Aggregation Function | ``DataFrame.agg`` supports? (Y/N/P) | ``Series.agg`` supports? (Y/N/P) | ``DataFrameGroupBy.agg`` supports? (Y/N/P) | ``SeriesGroupBy.agg`` supports? (Y/N/P) | |
| 22 | ++-----------------------------+-------------------------------------+----------------------------------+--------------------------------------------+-----------------------------------------+ |
| 23 | +| ``count`` | ``Y`` for ``axis=0``. | ``Y`` | ``Y`` | ``Y`` | |
| 24 | +| | For ``axis=1``, ``Y`` if index is | | | | |
| 25 | +| | not a MultiIndex. | | | | |
| 26 | ++-----------------------------+-------------------------------------+----------------------------------+--------------------------------------------+-----------------------------------------+ |
| 27 | +| ``mean`` | ``Y`` for ``axis=0``. | ``Y`` | ``Y`` | ``Y`` | |
| 28 | +| | ``N`` for ``axis=1``. | | | | |
| 29 | ++-----------------------------+-------------------------------------+----------------------------------+--------------------------------------------+-----------------------------------------+ |
| 30 | +| ``min`` | ``Y`` for ``axis=0``. | ``Y`` | ``Y`` | ``Y`` | |
| 31 | +| | For ``axis=1``, ``Y`` if index is | | | | |
| 32 | +| | not a MultiIndex. | | | | |
| 33 | ++-----------------------------+-------------------------------------+----------------------------------+--------------------------------------------+-----------------------------------------+ |
| 34 | +| ``max`` | ``Y`` for ``axis=0``. | ``Y`` | ``Y`` | ``Y`` | |
| 35 | +| | For ``axis=1``, ``Y`` if index is | | | | |
| 36 | +| | not a MultiIndex. | | | | |
| 37 | ++-----------------------------+-------------------------------------+----------------------------------+--------------------------------------------+-----------------------------------------+ |
| 38 | +| ``sum`` | ``Y`` for ``axis=0``. | ``Y`` | ``Y`` | ``Y`` | |
| 39 | +| | For ``axis=1``, ``Y`` if index is | | | | |
| 40 | +| | not a MultiIndex. | | | | |
| 41 | ++-----------------------------+-------------------------------------+----------------------------------+--------------------------------------------+-----------------------------------------+ |
| 42 | +| ``median`` | ``Y`` for ``axis=0``. | ``Y`` | ``Y`` | ``Y`` | |
| 43 | +| | ``N`` for ``axis=1``. | | | | |
| 44 | ++-----------------------------+-------------------------------------+----------------------------------+--------------------------------------------+-----------------------------------------+ |
| 45 | +| ``size`` | ``Y`` for ``axis=0``. | ``Y`` | ``Y`` | ``Y`` | |
| 46 | +| | ``N`` for ``axis=1``. | | | | |
| 47 | ++-----------------------------+-------------------------------------+----------------------------------+--------------------------------------------+-----------------------------------------+ |
| 48 | +| ``std`` | ``P`` for ``axis=0`` - only when | ``P`` - only when ``ddof=0`` | ``P`` - only when ``ddof=0`` | ``P`` - only when ``ddof=0`` | |
| 49 | +| | ``ddof=0`` or ``ddof=1``. | or ``ddof=1``. | or ``ddof=1``. | or ``ddof=1``. | |
| 50 | +| | ``N`` for ``axis=1``. | | | | |
| 51 | ++-----------------------------+-------------------------------------+----------------------------------+--------------------------------------------+-----------------------------------------+ |
| 52 | +| ``var`` | ``P`` for ``axis=0`` - only when | ``P`` - only when ``ddof=0`` | ``P`` - only when ``ddof=0`` | ``P`` - only when ``ddof=0`` | |
| 53 | +| | ``ddof=0`` or ``ddof=1``. | or ``ddof=1``. | or ``ddof=1``. | or ``ddof=1``. | |
| 54 | +| | ``N`` for ``axis=1``. | | | | |
| 55 | ++-----------------------------+-------------------------------------+----------------------------------+--------------------------------------------+-----------------------------------------+ |
| 56 | +| ``quantile`` | ``P`` for ``axis=0`` - only when | ``P`` - only when ``q`` is the | ``P`` - only when ``q`` is the | ``P`` - only when ``q`` is the | |
| 57 | +| | ``q`` is the default value or | default value or a scalar. | default value or a scalar. | default value or a scalar. | |
| 58 | +| | a scalar. | | | | |
| 59 | +| | ``N`` for ``axis=1``. | | | | |
| 60 | ++-----------------------------+-------------------------------------+----------------------------------+--------------------------------------------+-----------------------------------------+ |
| 61 | +| ``len`` | ``N`` | ``N`` | ``Y`` | ``Y`` | |
| 62 | ++-----------------------------+-------------------------------------+----------------------------------+--------------------------------------------+-----------------------------------------+ |
0 commit comments