-
-
Notifications
You must be signed in to change notification settings - Fork 19.3k
BUG/TST: Series round with dtype object #62174
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: Series round with dtype object #62174
Conversation
In another PR you're going to make DataFrame do the same thing this does, right? If so, you'll need to change the Block behavior. |
|
i suspect this will also fix/change the DataFrame.round behavior? can you test that and address it in the whatsnew note |
|
This pull request is stale because it has been open for thirty days with no activity. Please update and respond to this comment if you're still interested in working on this. |
pandas/core/internals/blocks.py
Outdated
| self.values.shape | ||
| ) | ||
| except TypeError as err: | ||
| raise TypeError("Expected numeric entries for dtype object.") from err |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i dont think its necessary to catch-and-reraise
pandas/core/internals/blocks.py
Outdated
| raise TypeError("Expected numeric entries for dtype object.") from err | ||
|
|
||
| refs = None | ||
| if values is self.values: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it possible to have values is self.values? my intuition is "no"
|
@sharkipelago can you merge main and address comments. i think this is getting close to ready |
doc/source/whatsnew/vX.X.X.rstfile if fixing a bug or adding a new feature.I changed the behavior or series.round() to act like
series.map(round)if the dtype is object as discussed in #61682. I put this in a new PR as the original intent of the other PR was to change DataFrame behavior. I'm unsure if the way I approached it is a good way to make the change though because I saw incore/internals/blocks.pythatBlock'sround()method is intended to raise an error for dtype of object. So I wasn't sure I should approach this by updated theBlockclass instead. Any feedback is appreciated!