polars.Series.extend_constant#

Series.extend_constant(value: int | float | str | bool | None, n: int) Series[source]#

Extend the Series with given number of values.

Parameters:
value

The value to extend the Series with. This value may be None to fill with nulls.

n

The number of values to extend.

Examples

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