convert a nested dataframe to multiindex