DataFrame.__setitem__ with MultiIndex fails when expanding with new key #27248
Labels
Bug
Indexing
Related to indexing on series/frames, not to indexes themselves
MultiIndex
setitem-with-expansion
Problem description
I know there is a workaround for this by adding , : but I feel the behavior is not intuitive as it is implemented. I think the arguments to getitem and setitem should be treated consistently and also an assignment over setitem should work the same way for simple indexes (with one level) and for multilevel indexes.
A formatted description of this can be viewed on stackoverflow here:
Stackoverflow description
Expected Output
Output of
pd.show_versions()
The text was updated successfully, but these errors were encountered: