polars.dataframe.group_by.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.group_by("a", maintain_order=True).all()
shape: (2, 2)
┌─────┬───────────┐
│ a   ┆ b         │
│ --- ┆ ---       │
│ str ┆ list[i64] │
╞═════╪═══════════╡
│ one ┆ [1, 3]    │
│ two ┆ [2, 4]    │
└─────┴───────────┘