-
-
Notifications
You must be signed in to change notification settings - Fork 18.9k
Closed
Labels
API DesignDtype ConversionsUnexpected or buggy dtype conversionsUnexpected or buggy dtype conversions
Milestone
Description
If you call the new round
method on a mixed dataframe (not only numerical columns), you get an error:
In [1]: df = pd.DataFrame({'floats':[0.123, 0.156, 5.687], 'strings': ['a', 'b', 'c']})
In [2]: df.round(2)
TypeError: can't multiply sequence by non-int of type 'float'
In [3]: df.round()
AttributeError: 'str' object has no attribute 'rint'
Would it be better to ignore these non-numerical columns instead of raising an error?
Another option would be to drop these columns (like numerical aggregations like df.mean()
do).
Metadata
Metadata
Assignees
Labels
API DesignDtype ConversionsUnexpected or buggy dtype conversionsUnexpected or buggy dtype conversions