polars.Series.reshape#

Series.reshape(dims: tuple[int, ...]) Series[source]#

Reshape this Series to a flat Series or a Series of Lists.

Parameters:
dims

Tuple of the dimension sizes. If a -1 is used in any of the dimensions, that dimension is inferred.

Returns:
Series

If a single dimension is given, results in a flat Series of shape (len,). If a multiple dimensions are given, results in a Series of Lists with shape (rows, cols).