polars.Series.clear
-
Create an empty copy of the current Series, with zero to ‘n’ elements.
The copy has an identical name/dtype, but no data.
- Parameters:
-
- n
-
Number of (empty) elements to return in the cleared frame.
See also
-
clone -
Cheap deepcopy/clone.
Examples
>>> s = pl.Series("a", [None, True, False]) >>> s.clear() shape: (0,) Series: 'a' [bool] [ ]>>> s.clear(n=2) shape: (2,) Series: 'a' [bool] [ null null ]
Series.clear(
n: int = 0,
) → Series
© 2020 Ritchie Vink
© 2022 Polars contributors
Licensed under the MIT License.
https://docs.pola.rs/api/python/stable/reference/series/api/polars.Series.clear.html