Method: Polars::Functions#zeros
- Defined in:
- lib/polars/functions/repeat.rb
#zeros(n, dtype: Float64, eager: false) ⇒ Object
Construct a column of length n filled with zeros.
This is syntactic sugar for the repeat function.
109 110 111 112 113 114 115 116 |
# File 'lib/polars/functions/repeat.rb', line 109 def zeros(n, dtype: Float64, eager: false) if (zero = _one_or_zero_by_dtype(0, dtype)).nil? msg = "invalid dtype for `zeros`; found #{dtype}" raise TypeError, msg end repeat(zero, n, dtype: dtype, eager: eager).alias("zeros") end |