Skip to content

BUG: bug in multi-index where insert fails #9256

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

Merged
merged 1 commit into from
Jan 16, 2015

Conversation

behzadnouri
Copy link
Contributor

closes #9250

on master:

>>> df
         3rd
1st 2nd     
a   b      0
b   d      1
>>> df.loc[('b', 'x'), '3rd'] = 2  # this works!
>>> df
         3rd
1st 2nd     
a   b      0
b   d      1
    x      2
>>> df.loc[('b', 'a'), '3rd'] = -1  # fails! sets everything to -1
>>> df
         3rd
1st 2nd     
a   b     -1
b   d     -1
    x     -1
>>> df.loc[('b', 'b'), '3rd'] = 3  # erros!
NotImplementedError: Index._join_level on non-unique index is not implemented

on branch:

>>> df
         3rd
1st 2nd     
a   b      0
b   d      1
>>> df.loc[('b', 'x'), '3rd'] = 2
>>> df.loc[('b', 'a'), '3rd'] = -1
>>> df.loc[('b', 'b'), '3rd'] = 3
>>> df
         3rd
1st 2nd     
a   b      0
b   d      1
    x      2
    a     -1
    b      3

@jreback
Copy link
Contributor

jreback commented Jan 15, 2015

this feels like it should also fix #9250 (just reported), but does not...if you have a chance

@jreback jreback added Bug Indexing Related to indexing on series/frames, not to indexes themselves MultiIndex labels Jan 15, 2015
@jreback jreback added this to the 0.16.0 milestone Jan 15, 2015
@behzadnouri
Copy link
Contributor Author

@jreback updated the pr to handle #9250 as well

jreback added a commit that referenced this pull request Jan 16, 2015
BUG: bug in multi-index where insert fails
@jreback jreback merged commit 2c6b145 into pandas-dev:master Jan 16, 2015
@jreback
Copy link
Contributor

jreback commented Jan 16, 2015

@behzadnouri thanks! gr8 as usual!

@behzadnouri behzadnouri deleted the mi-insert branch January 17, 2015 11:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Indexing Related to indexing on series/frames, not to indexes themselves MultiIndex
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Setting with enlargement fails in presence of MultiIndex
2 participants