-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: indexing with string in multi-index for Period gives KeyError #9892
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
Further, the string syntax also does not work for assigning (but this was also the case in 0.14.2). While for a DatetimeIndex both accessing and assigning using a string indexer works. |
this is essentially a dupe of #3462 as the multi-index delegation is to the PeriodIndex which doesn't support this ATM. |
@jreback Possibly, but this did work in 0.14.1, while the issue you linked to was already broken (or not implemented) then. But of course possible the underlying issue is the same |
hmm, ok, Period does need a bit of attention |
This works again in 0.19.1:
However the result isn't the same as:
Should these return the same result? |
@mroeschke was there discussion somewhere else about the expected result here? i think the scalar np.nan makes more sense than a Series |
From SO:
Trying to select with a string gives a ValueError:
while it works with an explicit Period:
and it also works when not using multi-index notation (only accessing the first level):
df.loc['2013Q1', 'OMS']
and this did work in 0.14.1.
The text was updated successfully, but these errors were encountered: