polars.Series.sign#

Series.sign() Series[source]#

Compute the element-wise indication of the sign.

Examples

>>> s = pl.Series("a", [-9.0, -0.0, 0.0, 4.0, None])
>>> s.sign()
shape: (5,)
Series: 'a' [i64]
[
        -1
        0
        0
        1
        null
]