Check out example codes for "ipykernel_launcher.py:3: PerformanceWarning: indexing past lexsort depth may impact performance. This is separate from the ipykernel package so we can avoid doing imports until". It will help you in understanding the concepts better.

Code Example 1

arrays = [['bar', 'bar', 'baz', 'baz', 'foo', 'foo', 'qux', 'qux'],
         ['one', 'two', 'one', 'two', 'one', 'two', 'one', 'two']]


tuples = list(zip(*arrays))

tuples

index = pd.MultiIndex.from_tuples(tuples, names=['first', 'second'])

index


s = pd.Series(np.random.randn(8), index=index)

s

Learn ReactJs, React Native from akashmittal.com