Skip to content

BUG: Series/Frame invert dtypes #31183

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

Merged
merged 11 commits into from
Jan 23, 2020
Merged

Conversation

TomAugspurger
Copy link
Contributor

Fixes NDFrame.invert to preserve dtypes by applying things blockwise. Notably, this fixes ~Series[BooleanDtype].

This also provides a pattern for other unary ops, though I think that those are less pressing for 1.0, which should probably have a working ~Series[BooleanDtype]

cc @jorisvandenbossche

Fixes NDFrame.__invert__ to preserve dtypes. Noatably

* Dispatches to extension arrays
* Applies blockwise to avoid upcasting to a common dtype
@TomAugspurger TomAugspurger added Numeric Operations Arithmetic, Comparison, and Logical operations ExtensionArray Extending pandas with custom dtypes or arrays. labels Jan 21, 2020
@TomAugspurger TomAugspurger added this to the 1.0.0 milestone Jan 21, 2020
@TomAugspurger TomAugspurger changed the title BUG: Series/Frame invert dytpes BUG: Series/Frame invert dtypes Jan 21, 2020
TomAugspurger and others added 2 commits January 23, 2020 06:31
Co-Authored-By: Joris Van den Bossche <[email protected]>
Co-Authored-By: Joris Van den Bossche <[email protected]>
Copy link
Contributor

@jreback jreback left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

small comment

@TomAugspurger
Copy link
Contributor Author

All green.

@jreback jreback merged commit 351760c into pandas-dev:master Jan 23, 2020
@jreback
Copy link
Contributor

jreback commented Jan 23, 2020

thanks @TomAugspurger

@jorisvandenbossche
Copy link
Member

@meeseeksdev backport to 1.0.x

@lumberbot-app
Copy link

lumberbot-app bot commented Jan 31, 2020

Owee, I'm MrMeeseeks, Look at me.

There seem to be a conflict, please backport manually. Here are approximate instructions:

  1. Checkout backport branch and update it.
$ git checkout 1.0.x
$ git pull
  1. Cherry pick the first parent branch of the this PR on top of the older branch:
$ git cherry-pick -m1 351760c0655b6c383e449cf857b9a718e3545229
  1. You will likely have some merge/cherry-pick conflict here, fix them and commit:
$ git commit -am 'Backport PR #31183: BUG: Series/Frame invert dtypes'
  1. Push to a named branch :
git push YOURFORK 1.0.x:auto-backport-of-pr-31183-on-1.0.x
  1. Create a PR against branch 1.0.x, I would have named this PR:

"Backport PR #31183 on branch 1.0.x"

And apply the correct labels and milestones.

Congratulation you did some good work ! Hopefully your backport PR will be tested by the continuous integration and merged soon!

If these instruction are inaccurate, feel free to suggest an improvement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ExtensionArray Extending pandas with custom dtypes or arrays. Numeric Operations Arithmetic, Comparison, and Logical operations
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants