polars.Series.round_sig_figs#

Series.round_sig_figs(digits: int) Series[source]#

Round to a number of significant figures.

Parameters:
digits

Number of significant figures to round to.

Examples

>>> s = pl.Series([0.01234, 3.333, 1234.0])
>>> s.round_sig_figs(2)
shape: (3,)
Series: '' [f64]
[
        0.012
        3.3
        1200.0
]