pandas.Series.list.flatten#

Series.list.flatten()[source]#

Flatten list values.

Returns:
pandas.Series

The data from all lists in the series flattened.

Examples

>>> import pyarrow as pa
>>> s = pd.Series(
...     [
...         [1, 2, 3],
...         [3],
...     ],
...     dtype=pd.ArrowDtype(pa.list_(
...         pa.int64()
...     ))
... )
>>> s.list.flatten()
0    1
1    2
2    3
3    3
dtype: int64[pyarrow]