Non-intuitive behavior when multi-indexing a Series #35349
Labels
Bug
Error Reporting
Incorrect or improved errors from pandas
Indexing
Related to indexing on series/frames, not to indexes themselves
MultiIndex
Series
Series data structure
Milestone
Most likely that is not a bug but intended behavior but I find it quite confusing.
Consider the following example
which gives
while intuitively, one would expect
I would expect the latter because that's what you would get with a
pd.DataFrame
where the second:
is referring to the column index. Not paying attention that the object is a series, gives you a completely different result than if you would have a data frame.The text was updated successfully, but these errors were encountered: