polars.Series.index_of
-
Get the index of the first occurrence of a value, or
Noneif it’s not found.- Parameters:
-
- element
-
Value to find.
Examples
>>> s = pl.Series("a", [1, None, 17]) >>> s.index_of(17) 2 >>> s.index_of(None) # search for a null 1 >>> s.index_of(55) is None True
Series.index_of(
element: IntoExpr,
) → int | None
© 2020 Ritchie Vink
© 2022 Polars contributors
Licensed under the MIT License.
https://docs.pola.rs/api/python/stable/reference/series/api/polars.Series.index_of.html