pack_lists#
- nested_pandas.series.packer.pack_lists(df: DataFrame, name: str | None = None, *, validate: bool = True) NestedSeries[source]#
Make a series of arrow structures from a dataframe with nested arrays.
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.NestedDtypewith the corresponding pyarrow type. The index of the output series is the unique index of the input dataframe. The Series has.nestaccessor, seenested_pandas.NestSeriesAccessorfor details.For every row, all the nested array (aka pyarrow list) lengths must be the same.
- Parameters:
- Returns:
Output series, with unique indexes.
- Return type:
See also
nested_pandas.NestSeriesAccessorThe accessor for the output series.
nested_pandas.NestedDtypeThe dtype of the output series.
nested_pandas.series.packer.pack_flatPack a “flat” dataframe with repeated indexes.