polars.Series.round#

Series.round(decimals: int = 0) Series[source]#

Round underlying floating point data by decimals digits.

Parameters:
decimals

number of decimals to round by.

Examples

>>> s = pl.Series("a", [1.12345, 2.56789, 3.901234])
>>> s.round(2)
shape: (3,)
Series: 'a' [f64]
[
        1.12
        2.57
        3.9
]