Spec-Zone.ru › Polars

polars.Series.limit

Series.limit(
    n: int = 10,
) → Series

Get the first n elements.

Alias for Series.head().

Parameters:
n

Number of elements to return. If a negative value is passed, return all elements except the last abs(n).

See also

head

Examples

>>> s = pl.Series("a", [1, 2, 3, 4, 5])
>>> s.limit(3)
shape: (3,)
Series: 'a' [i64]
[
    1
    2
    3
]

Pass a negative value to get all rows except the last abs(n).

>>> s.limit(-3)
shape: (2,)
Series: 'a' [i64]
[
    1
    2
]

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

Spec-Zone.ru

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