polars.Series.slice
-
Get a slice of this Series.
- Parameters:
-
- offset
-
Start index. Negative indexing is supported.
- length
-
Length of the slice. If set to
None, all rows starting at the offset will be selected.
Examples
>>> s = pl.Series("a", [1, 2, 3, 4]) >>> s.slice(1, 2) shape: (2,) Series: 'a' [i64] [ 2 3 ]
Series.slice(
offset: int,
length: int | None = None,
) → Series
© 2020 Ritchie Vink
© 2022 Polars contributors
Licensed under the MIT License.
https://docs.pola.rs/api/python/stable/reference/series/api/polars.Series.slice.html