-
-
Notifications
You must be signed in to change notification settings - Fork 18.6k
BUG/TST: added TypeError if object dtypes are detected in dataframe #61682
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
BUG/TST: added TypeError if object dtypes are detected in dataframe #61682
Conversation
The second concern of the issue #55114 was If |
i would expect this to attempt to operate pointwise (which would still raise on e.g. strings) |
Do you mean I should rewrite the code so that it attempts to round every column individually and then raise if there is a non-numeric column? As opposed to looking at the |
Ohh because |
im specifically thinking of object dtype columns containing numeric entries |
Ah okay, makes sense. I think the current behavior for The
Should I submit a PR to change this behavior first before implementing your pointwise solution? |
doc/source/whatsnew/vX.X.X.rst
file if fixing a bug or adding a new feature.This PR addresses concern 1 of #55114 - Having consistent behavior with
Series.round
&DataFrame.round
.My solution was to raise a
TypeError
in a way similar way to #61206.I changed the following existing tests, but a little worried that might break some things, so any feedback is appreciated.
tests/frrame/methods/test_round.py
'stest_round_mixed_type
as I felt that test conflicted with the current intended behavior ofDataFrame.round
tests/copy_view/test_methods.py
'stest_round
as it was using a dataframe with strings and ints in its test