I am trying to convert a Pandas multi-index to a table. I have tried stacking, unstacking, and cross-sections, but nothing seems to give quite the right output.
The multi-index table looks like this:
I would like to convert it to a format like this:
yearmo cohort_string sum count
2018-01 Bonds 76418 17.0
2018-01 Bonds+Car Loan 18538.0 17.0
2018-01 Bonds+Car Loan+Checking+Credit Card 48248.0 3.0
...
I know I could loop over the object and pull apart the pieces but there has to be a simpler way. I have spent more time on this than I care to admit, any help would be much appreciated.