I am a little embarrassed to say that I have been quite enjoying this last stretch of posts. Nothing really productive and a long way from my stated goal of learning about data science and machine learning. But, it has been fun just learning something about these Python packages. And, we aren’t quite done yet.

Hierarchical Indexing

AKA multi-indexing.

I gather this will have some value in future. Time will tell, but it is sort of interesting. And, believe it or not, we had a brief glimpse of multi-indexing in the last post. You may recall we used .stack() on one of the dice roll DataFrames to convert the DataFrame into a Series. We were then able to use .median() to get the median of all the dice rolls in that DataFrame. The resulting Series looked like this:

0  green    3
   red      6
   blue     1
1  green    5
   red      2
   blue     1
2  green    4
   red      6
   blue     5
dtype: int64