I have the following script:
data = {
'File':[1,1,2,2,3],
'Sheet':['Sheet 1','Sheet 1','Sheet 3','Sheet3','Sheet5'],
'Duration':[2,5,3,7,9],
'Cost':[7,5,8,9,3],
'Distance':[2,4,5,7,5]
}
df=pd.DataFrame(data)
df.columns=[['Set X','Set X','Set Y','Set Y','Set Z'],['File','Sheet','Duration','Cost','Distance']]
I would like to separate this single dataframe into 3 dataframes based on the 'File' type and 'Sheet' type, such that the 3 separate dataframes looks like this:

How should I script with the multiindex? Thank you in advance :)