-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
Index.intersection bug? #8362
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
Comments
can I show pandas version |
>>> pd.version.version
'0.14.1' |
yep this is a non-tested case of non-monotinic non-unique indexers which results in care to do a pull-request? (last case in |
This looks like the problem: try:
indexer = self.get_indexer(other.values)
indexer = indexer.take((indexer != -1).nonzero()[0])
except:
# duplicates
indexer = self.get_indexer_non_unique(other.values)[0].unique() Do you think this would make more sense? try:
indexer = self.get_indexer_non_unique(other.values)[0].unique()
indexer = self.get_indexer(other.values)
indexer = indexer.take((indexer != -1).nonzero()[0])
except:
raise |
no much simpler before the take do indexer = indexer[indexer != -1] -1 is the get_indexer placeholder for missing so needs to be taken out |
closed by #8374 |
I ran into an odd behaviour when taking the intersection of two Indexes. Specifically,
returns
However, I would expect this to return
If
Index(['B', 'C'], dtype='object')
is the intended behaviour, can someone explain the rationale behind it?The text was updated successfully, but these errors were encountered: