- Series.extend_constant(value: PythonLiteral | None, n: int) Series #
Extremely fast method for extending the Series with ‘n’ copies of a value.
A constant literal value (not an expression) with which to extend the Series; can pass None to extend with nulls.
The number of additional values that will be added.
>>> s = pl.Series([1, 2, 3]) >>> s.extend_constant(99, n=2) shape: (5,) Series: '' [i64] [ 1 2 3 99 99 ]