Spec-Zone.ru › Polars

polars.Series.interpolate_by

Series.interpolate_by(
    by: IntoExpr,
) → Series

Interpolate intermediate values with x-coordinate based on another column.

Nulls at the beginning and end of the series remain null.

Parameters:
by

Column to interpolate values based on.

Examples

Fill null values using linear interpolation.

>>> s = pl.Series([1, None, None, 3])
>>> by = pl.Series([1, 2, 7, 8])
>>> s.interpolate_by(by)
shape: (4,)
Series: '' [f64]
[
    1.0
    1.285714
    2.714286
    3.0
]

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

Spec-Zone.ru

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