-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
loc misbehaves when Period is at start of 3-level MultiIndex #20684
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
Labels
Indexing
Related to indexing on series/frames, not to indexes themselves
MultiIndex
Period
Period data type
Milestone
Comments
periods in a multiindex are not very well tested / supported for indexing. you are welcome to submit a patch. |
May i take a look? |
Yep, doesn't look like anyone else is working on this.
…On Fri, Aug 16, 2019 at 12:27 AM proost ***@***.***> wrote:
May i take a look?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#20684?email_source=notifications&email_token=AAKAOISLBI5HOZUAHYPOAPDQEY3EFA5CNFSM4E2NHBM2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD4NWIBQ#issuecomment-521888774>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAKAOIUTCCOEZQENBFROKSTQEY3EFANCNFSM4E2NHBMQ>
.
|
proost
added a commit
to proost/pandas
that referenced
this issue
Sep 26, 2019
(pandas-dev#20684) If index is MultiIndex and level of 0 is PeriodIndex, loc function raise exception if all input of loc does not match index values
5 tasks
proost
added a commit
to proost/pandas
that referenced
this issue
Sep 28, 2019
(pandas-dev#20684) If index is MultiIndex and level of 0 is PeriodIndex, loc function raise exception if all input of loc does not match index values
proost
added a commit
to proost/pandas
that referenced
this issue
Oct 10, 2019
(pandas-dev#20684) If `MultiIndex` nlevel is 3 and first level index is `PeriodIndex`, `.loc` would raise exception with a miss match key
proost
added a commit
to proost/pandas
that referenced
this issue
Oct 10, 2019
(pandas-dev#20684) If `MultiIndex` nlevel is 3 and first level index is `PeriodIndex`, `.loc` would raise exception with a miss match key
proost
added a commit
to proost/pandas
that referenced
this issue
Oct 10, 2019
(pandas-dev#20684) If `MultiIndex` nlevel is 3 and first level index is `PeriodIndex`, `.loc` would raise exception with a miss match key
proost
added a commit
to proost/pandas
that referenced
this issue
Oct 16, 2019
(pandas-dev#20684) If `MultiIndex` is in PeriodIndex, `.loc` would raise exception with a miss match key
proost
added a commit
to proost/pandas
that referenced
this issue
Oct 22, 2019
(pandas-dev#20684) If `MultiIndex` is in PeriodIndex, `.loc` would raise exception with a miss match key Remove `PeriodEngine.get_loc` in `PeriodIndex.get_loc`
proost
added a commit
to proost/pandas
that referenced
this issue
Oct 23, 2019
(pandas-dev#20684) If `MultiIndex` is in PeriodIndex, `.loc` would raise exception with a miss match key `PeriodEngine.get_loc` can't accept Period
proost
added a commit
to proost/pandas
that referenced
this issue
Oct 23, 2019
(pandas-dev#20684) If `MultiIndex` is in PeriodIndex, `.loc` would raise exception with a miss match key `PeriodEngine.get_loc` only accept Period.ordinal
proost
added a commit
to proost/pandas
that referenced
this issue
Oct 23, 2019
(pandas-dev#20684) If `MultiIndex` is in PeriodIndex, `.loc` would raise exception with a miss match key `PeriodEngine.get_loc` only accept Period.ordinal
proost
added a commit
to proost/pandas
that referenced
this issue
Oct 24, 2019
(pandas-dev#20684) If `MultiIndex` is in PeriodIndex, `.loc` would raise exception with a miss match key `PeriodEngine.get_loc` only accept Period.ordinal
proost
added a commit
to proost/pandas
that referenced
this issue
Oct 24, 2019
(pandas-dev#20684) If `MultiIndex` is in PeriodIndex, `.loc` would raise exception with a miss match key
proost
added a commit
to proost/pandas
that referenced
this issue
Oct 24, 2019
(pandas-dev#20684) If `MultiIndex` is in PeriodIndex, `.loc` would raise exception with a miss match key
proost
added a commit
to proost/pandas
that referenced
this issue
Oct 25, 2019
(pandas-dev#20684) If `MultiIndex` is in PeriodIndex, `.loc` would raise exception with a miss match key
proost
added a commit
to proost/pandas
that referenced
this issue
Oct 25, 2019
proost
added a commit
to proost/pandas
that referenced
this issue
Oct 26, 2019
proost
added a commit
to proost/pandas
that referenced
this issue
Oct 26, 2019
This was fixed by #28628 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Indexing
Related to indexing on series/frames, not to indexes themselves
MultiIndex
Period
Period data type
Code Sample
Problem description
I'd expect
loc
to return a scalar value when there's a unique match, rather than aSeries
with one item in it.I'd also expect a
KeyError
when the second and third levels of the index don't match (the 'wibble' and 'wobble' selections). Instead it appears that the additional levels are ignored, and matches succeed or fail based on the period alone.Expected Output
Everything works as I expect when I use strings instead of
Period
s:Things also work as I'd expect when there are only two levels in the
MultiIndex
(or four, or five):It also works if I put
Period
last in the three-levelMultiIndex
:... or second:
Output of
pd.show_versions()
[paste the output of
pd.show_versions()
here below this line]INSTALLED VERSIONS
commit: None
python: 2.7.10.final.0
python-bits: 64
OS: Darwin
OS-release: 17.4.0
machine: x86_64
processor: i386
byteorder: little
LC_ALL: None
LANG: en_GB.UTF-8
LOCALE: None.None
pandas: 0.22.0
pytest: None
pip: 9.0.3
setuptools: 39.0.1
Cython: None
numpy: 1.14.2
scipy: None
pyarrow: None
xarray: None
IPython: None
sphinx: None
patsy: None
dateutil: 2.7.2
pytz: 2018.4
blosc: None
bottleneck: None
tables: None
numexpr: None
feather: None
matplotlib: None
openpyxl: None
xlrd: None
xlwt: None
xlsxwriter: None
lxml: None
bs4: None
html5lib: None
sqlalchemy: None
pymysql: None
psycopg2: None
jinja2: 2.10
s3fs: None
fastparquet: None
pandas_gbq: None
pandas_datareader: 0.5.0
The text was updated successfully, but these errors were encountered: