Spec-Zone.ru › Polars

polars.Series.to_init_repr

Series.to_init_repr(
    n: int = 1000,
) → str_

Преобразовать Series в строковое представление, пригодное для создания экземпляра.

Параметры:
n

Использовать только первые n элементов.

См. также

polars.Series.to_init_repr
polars.from_repr

Примеры

>>> s = pl.Series("a", [1, 2, None, 4], dtype=pl.Int16)
>>> print(s.to_init_repr())
pl.Series('a', [1, 2, None, 4], dtype=pl.Int16)
>>> s_from_str_repr = eval(s.to_init_repr())
>>> s_from_str_repr
shape: (4,)
Series: 'a' [i16]
[
    1
    2
    null
    4
]

© 2020 Ritchie Vink
© 2022 Polars contributors
Licensed under the MIT License.
https://docs.pola.rs/api/python/stable/reference/series/api/polars.Series.to_init_repr.html

Spec-Zone.ru

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