effective-pandas icon indicating copy to clipboard operation
effective-pandas copied to clipboard

Intro notebook UnsortedIndexError on the date range (cell 18)

Open g2boojum opened this issue 7 years ago • 1 comments

The last cell of notebook 1 is throwing an exception, along with the message: UnsortedIndexError: 'MultiIndex slicing requires the index to be lexsorted: slicing on levels [4], lexsort depth 3'. I don't understand this, since cell 13 seems like it should be sorting the index.

python 3.7, pandas 0.23.4 and 0.24.1.

Incidentally, upgrading to 0.24.1 also broke cell 6, which crashes with KeyError: "['tail_num'] not in index" (which I don't understand at all).

All of that said, I've now learned about IndexSlice, which is truly awesome! Thanks.

g2boojum avatar Feb 04 '19 23:02 g2boojum

I had the same problem and it was solved by setting the parameter level=[...] inside sort_index (right next to set_index)

vidalgp avatar Sep 12 '19 22:09 vidalgp