Skip to content

BUG: fix get_indexer_non_unique with CategoricalIndex key #21457

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 1 commit into from
Jun 13, 2018

Conversation

toobaz
Copy link
Member

@toobaz toobaz commented Jun 13, 2018

@toobaz toobaz added Indexing Related to indexing on series/frames, not to indexes themselves Categorical Categorical Data Type labels Jun 13, 2018
@jreback jreback added this to the 0.23.2 milestone Jun 13, 2018
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.

minor comment. merge when on green.

@@ -598,7 +598,11 @@ def get_indexer_non_unique(self, target):
target = ibase._ensure_index(target)

if isinstance(target, CategoricalIndex):
target = target.categories
if target.categories is self.categories:
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 add a comment here about what you are doing (e.g. why this conditional)

@toobaz toobaz force-pushed the non_unique_categorical_21448 branch from d5aee5c to 2296f17 Compare June 13, 2018 10:33
@codecov
Copy link

codecov bot commented Jun 13, 2018

Codecov Report

Merging #21457 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #21457      +/-   ##
==========================================
+ Coverage   91.89%    91.9%   +<.01%     
==========================================
  Files         153      153              
  Lines       49600    49606       +6     
==========================================
+ Hits        45580    45589       +9     
+ Misses       4020     4017       -3
Flag Coverage Δ
#multiple 90.3% <100%> (ø) ⬆️
#single 41.89% <14.28%> (+0.02%) ⬆️
Impacted Files Coverage Δ
pandas/core/indexes/category.py 97.06% <100%> (+0.03%) ⬆️
pandas/core/indexes/base.py 96.62% <100%> (ø) ⬆️
pandas/tseries/offsets.py 97.24% <0%> (+0.24%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8eb4937...85f0c70. Read the comment docs.

@toobaz toobaz force-pushed the non_unique_categorical_21448 branch from 2296f17 to 85f0c70 Compare June 13, 2018 10:34
@toobaz toobaz merged commit 576d5c6 into pandas-dev:master Jun 13, 2018
@toobaz toobaz deleted the non_unique_categorical_21448 branch June 13, 2018 13:24
david-liu-brattle-1 pushed a commit to david-liu-brattle-1/pandas that referenced this pull request Jun 18, 2018
jorisvandenbossche pushed a commit that referenced this pull request Jun 29, 2018
jorisvandenbossche pushed a commit that referenced this pull request Jul 2, 2018
Sup3rGeo pushed a commit to Sup3rGeo/pandas that referenced this pull request Oct 1, 2018
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Index.get_indexer_non_unique misbehaves when passed a CategoricalIndex
3 participants