polars.dataframe.groupby.GroupBy.all#

GroupBy.all() DataFrame[source]#

Aggregate the groups into Series.

Examples

>>> df = pl.DataFrame({"a": ["one", "two", "one", "two"], "b": [1, 2, 3, 4]})
>>> df.groupby("a", maintain_order=True).all()
shape: (2, 2)
┌─────┬───────────┐
│ a   ┆ b         │
│ --- ┆ ---       │
│ str ┆ list[i64] │
╞═════╪═══════════╡
│ one ┆ [1, 3]    │
│ two ┆ [2, 4]    │
└─────┴───────────┘