-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Closed
Labels
enhancementNew feature or an improvement of an existing featureNew feature or an improvement of an existing feature
Description
Description
In python, round() usually means “Rounding half to even”, but polars Series.round()/Expr.round() do not. It should be adding an argument such as to_even to the method. At the very least, there should be a note in the documentation.
round(0.5) # -> 0
np.round(0.5) # -> np.float64(0.0)
pd.Series(0.5).round()[0] # -> np.float64(0.0)
pl.Series([0.5]).round().item() # -> 1.0expected:
pl.Series([0.5]).round(to_even=True).item() # -> 0.0eitsupi, lorentzenchr and thomas-chauvet
Metadata
Metadata
Assignees
Labels
enhancementNew feature or an improvement of an existing featureNew feature or an improvement of an existing feature