polars.zeros#
- polars.zeros( ) Expr | Series [source]#
Construct a column of length
n
filled with zeros.This is syntactic sugar for the
repeat
function.- Parameters:
- n
Length of the resulting column.
- dtype
Data type of the resulting column. Defaults to Float64.
- eager
Evaluate immediately and return a
Series
. If set toFalse
, return an expression instead.
Notes
If you want to construct a column in lazy mode and do not need a pre-determined length, use
lit()
instead.Examples
>>> pl.zeros(3, pl.Int8, eager=True) shape: (3,) Series: 'zeros' [i8] [ 0 0 0 ]