如何对 Polars 中的值进行四舍五入

Jah*_*ear 4 dataframe python-polars

我有一些计算的浮点列。我想显示四舍五入的一列的值,但round(pl.col("value"), 2)在 Polars 中无法正确旋转。我怎样才能做到呢?

小智 10

df.with_column(
    pl.col("x").round(2)
)
Run Code Online (Sandbox Code Playgroud)