Here is a table
df = {'index':['Larry','Moe','Curly'],
'age':[54,58,65],
'eye':['blue','brown','brown'],
'fortune':[1,1.5,1.2],
'food':['pizza','pasta','burgers'],
'job':['actor','actor','actor'],
'kids':[2,3,4]}
df = pd.DataFrame(df)
df = df.set_index('index')
I would like to create 3 mini tables from this table and save each mini table as a sheet in 1 excel file. The first stage should contain columns age and eye, second, fortune & food and the third, job and kids.
This is what I've attempted, but it doesn't make much sense
col = df.columns
with pd.Excelwriter('filename' + '.xlsx') as xlswriter:
for col in df:
col = col[::2]
df.to_excel(xlswriter, index=False, sheet_name = 'sheet' )