polars.Series.interpolate#

Series.interpolate(method: InterpolationMethod = 'linear') Series[source]#

Interpolate intermediate values. The interpolation method is linear.

Parameters:
method{‘linear’, ‘linear’}

Interpolation method

Examples

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