Match multi-index in parallel dataframe
You can use
percentage.set_index(['col1', 'col2'])
to make the same columns be the index, but the two tables won't nessecarily have the same index values or sorting. If you if you want to make sure percentage has exactly the same index as count, then after that you can also do
percentage.reindex(count.index)
but note that you'll end up with null values in your data for any index values that are in count but not percentage, and you'll throw away any rows of percentage where the index value doesn't show up in `count.
Edit:
If you want to do this but don't already know the names of the index columns, you can get them with count.index.names.
I've got two DataFrames, count, and percentage with the same columns. count has a multi-level index. I want to use percentage.set_index(....) to make the index of percentage match the index of count. How do I do this?