Jun-20-2019, 11:05 PM
The code above runs without any errors on my computer (pandas version: 0.23.4).
reset_index
method turns pandas multi-index to columns, that is almost what you want.