Spec-Zone.ru › Polars

polars.DataFrame.get_column_index

DataFrame.get_column_index(
    name: str,
) → int

Найти индекс столбца по его имени.

Параметры:
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

© 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

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API