polars.Series.view

Series.view(ignore_nulls: bool = False) numpy.ndarray

Get a view into this Series data with a numpy array. This operation doesn’t clone data, but does not include missing values. Don’t use this unless you know what you are doing.

Warning

This function can lead to undefined behavior in the following cases:

Returns a view to a piece of memory that is already dropped:

>>> pl.Series([1, 3, 5]).sort().view()  

Sums invalid data that is missing:

>>> pl.Series([1, 2, None]).view().sum()