Hierarchical Indexing
Let’s learn about hierarchical and multilevel indexing of DataFrames in pandas.
Hierarchical indexing is another very important feature of pandas. It makes it possible to have multiple (two or more) index levels on an axis. Putting it somewhat abstractly, it provides a way to work with higher-dimensional data in a lower-dimensional form.
This simple example helps to illustrate this point:
Get hands-on with 1200+ tech skills courses.