polars.DataFrame.get_column_index
-
Найти индекс столбца по его имени.
- Параметры:
-
- name
-
Имя столбца, который нужно найти.
Примеры
>>> df = pl.DataFrame( ... {"foo": [1, 2, 3], "bar": [6, 7, 8], "ham": ["a", "b", "c"]} ... ) >>> df.get_column_index("ham") 2 >>> df.get_column_index("sandwich") ColumnNotFoundError: sandwich
DataFrame.get_column_index(
name: str,
) → int
© 2020 Ritchie Vink
© 2022 Polars contributors
Licensed under the MIT License.
https://docs.pola.rs/api/python/stable/reference/dataframe/api/polars.DataFrame.get_column_index.html