-
-
Notifications
You must be signed in to change notification settings - Fork 17.5k
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
MultiIndex loc for value not in index #4443
Comments
This looks legit, you are asking for a starting tuple with no stopping tuple, so you get the rest of the index
|
@jreback but don't we expect:
rather than KeyError? |
nope....that's according to spec, then endpoints must be included I get that this since there is a defined ordering that this should work (and might in cases of datetimes), where lookup is 'approximate', e.g. s['2000'] would start at the first datetime of 2000 (even if its much later) but s.loc['2000'] would not I think OP is best by doing this using a multi-index, a list of tuples is essentially (but not exactly the same)
|
Ha! So the error is that this totally isn't a MultiIndex. Sorry |
is it weird that using loc this gives an error?
|
that's correct |
not sure I follow why this works without loc but not with loc... |
|
example:
Should this work? cc @jreback
From SO question.
The text was updated successfully, but these errors were encountered: