pandas.Series.list.flatten#
- Series.list.flatten()[source]#
Flatten list values.
- Returns:
- pandas.Series
The data from all lists in the series flattened.
See also
ListAccessor.__getitem__
Index or slice values in the Series.
Examples
>>> import pyarrow as pa >>> s = pd.Series( ... [ ... [1, 2, 3], ... [3], ... ], ... dtype=pd.ArrowDtype(pa.list_(pa.int64())), ... ) >>> s.list.flatten() 0 1 0 2 0 3 1 3 dtype: int64[pyarrow]