pack_flat#
- pack_flat(df: DataFrame, name: str | None = None, *, on: None | str | list[str] = None) NestedSeries[source]#
Make a structure of lists representation of a “flat” dataframe.
For the input dataframe with repeated indexes, make a pandas.Series, where each original column is replaced by a structure of lists. The dtype of the column is nested_pandas.NestedDtype with the corresponding pyarrow type. The index of the output series is the unique index of the input dataframe. The Series has .nest accessor, see
nested_pandas.series.accessor.NestSeriesAccessor()for details.- Parameters:
- Returns:
Output series, with unique indexes.
- Return type:
See also
nested_pandas.series.accessor.NestSeriesAccessor.nest accessor for the output series.
nested_pandas.series.dtype.NestedDtypeThe dtype of the output series.
nested_pandas.series.packer.pack_listsPack a dataframe of nested arrays.