Pandas official documentation on the cut function (http://bit.ly/2whcUkJ) Refer to Chapter 14, Restructuring Data into a Tidy Form, for many more recipes with unstack