-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
Bug behavior when checking element inclusion in non-unique MultiIndex #7724
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
why are you doing the is checking? why are you not simply indexing? |
I am not sure that I understand what you mean by "the is checking"? |
typo, should be |
oh, ok. |
and? so why are you checking if something is in the index? |
the dataframe is indexed by (date, hour). |
why are you not simply using a DatetimeIndex. Then grouping/resampling as needed? |
checking like this is very inefficient |
To be honest, I am not sure I know how to do what you have proposed. |
why don't you show somedata, then what you are doing with it |
So let's say I have a table like the following:
I might want to
but the process that fetches |
and so what with the given day/hour combo? |
again, I am not sure I understand the question? |
You are much better off using
This is the power of grouping. Grouping by the day and color to produce a multi indexed frame according to the aggregation scheme.
|
That should work fantastically! Thank you. |
Just a note: Regardless of whether this particular use case can be done another way, I think we need to keep in mind what the API is. If the index containment API is that |
cc @BrenBarn it's marked as a bug (and not hard to fix) |
I am using
pandas.__version__==0.14.0
.This is my first bug report in github so excuse my possibly poorly formatted submission.
This bug report might be related to, or duplicate:
It was explained to me by [http://stackoverflow.com/users/1427416/brenbarn] on the following StackOverflow question, http://stackoverflow.com/questions/24683023/having-issue-with-hierarchical-index-set-behavior/24684844#24684844
Essentially, the following behavior is not desirable:
since it prints:
0.14.0
X Y
0 1
1
True
True
True
True
despite the fact that
(100,0)
and(100,100)
are unambiguously not part of the index.The text was updated successfully, but these errors were encountered: