Skip to content

BUG: Regression in logical ops raising ValueError with Categorical columns with unused categories #38532

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 3 commits into from
Dec 21, 2020

Conversation

phofl
Copy link
Member

@phofl phofl commented Dec 16, 2020

@simonjayhawkins

This would fix the issue, but is pretty dirty. If we decide to merge this, we should remove this again with #38140 Also test would have to be adjusted (expected remove unused category)

@phofl phofl added the Regression Functionality that used to work in a prior pandas version label Dec 16, 2020
@jreback jreback added Categorical Categorical Data Type Indexing Related to indexing on series/frames, not to indexes themselves labels Dec 16, 2020
@simonjayhawkins simonjayhawkins added this to the 1.2 milestone Dec 18, 2020
cols = left.columns.intersection(right.columns)
# Only doing unique because of CategoricalIndex. Can be removed after
# GH#38140 is merged
cols = left.columns.intersection(right.columns).unique()
Copy link
Contributor

Choose a reason for hiding this comment

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

can you just do the intersection after L318?

Copy link
Member Author

Choose a reason for hiding this comment

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

Way better, thank you very much.

@jreback jreback merged commit e18ed3e into pandas-dev:master Dec 21, 2020
@jreback
Copy link
Contributor

jreback commented Dec 21, 2020

thanks @phofl

@jreback
Copy link
Contributor

jreback commented Dec 21, 2020

@meeseeksdev backport 1.2.x

meeseeksmachine pushed a commit to meeseeksmachine/pandas that referenced this pull request Dec 21, 2020
…ValueError with Categorical columns with unused categories
jreback pushed a commit that referenced this pull request Dec 21, 2020
… with Categorical columns with unused categories (#38612)

Co-authored-by: patrick <[email protected]>
@phofl phofl deleted the 38367 branch December 21, 2020 15:50
luckyvs1 pushed a commit to luckyvs1/pandas that referenced this pull request Jan 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Categorical Categorical Data Type Indexing Related to indexing on series/frames, not to indexes themselves Regression Functionality that used to work in a prior pandas version
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: Pandas 1.1.5 location-based indexing error with quantized pivot table
3 participants