Spec-Zone.ru › Polars

polars.Series.extend_constant

Series.extend_constant(
    value: IntoExpr,
    n: int | IntoExprColumn,
) → Series

Extremely fast method for extending the Series with ‘n’ copies of a value.

Parameters:
value

A constant literal value or a unit expression with which to extend the expression result Series; can pass None to extend with nulls.

n

The number of additional values that will be added.

Examples

>>> s = pl.Series([1, 2, 3])
>>> s.extend_constant(99, n=2)
shape: (5,)
Series: '' [i64]
[
    1
    2
    3
    99
    99
]

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

Spec-Zone.ru

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