polars.Series.interpolate_by
-
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 ]
Series.interpolate_by(
by: IntoExpr,
) → Series
© 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