File: groupby.rst

package info (click to toggle)
pandas 2.3.1%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 66,800 kB
  • sloc: python: 424,812; ansic: 9,190; sh: 264; xml: 102; makefile: 86
file content (7 lines) | stat: -rw-r--r-- 275 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
pandas provides a flexible ``groupby`` mechanism that allows similar aggregations. See the
:ref:`groupby documentation<groupby>` for more details and examples.

.. ipython:: python

   tips_summed = tips.groupby(["sex", "smoker"])[["total_bill", "tip"]].sum()
   tips_summed