Search code examples
dataframepython-polars

How I can round up values in Polars


I have some calculated float columns. I want to display values of one column rounded, but round(pl.col("value"), 2) not working properly in Polars. How I can make it?


Solution

  • Polars has a .round() expression.

    df.with_columns(
        pl.col("x").round(2)
    )