我正在尝试根据groupby函数为两列创建的不同数据框在python中编写不同的工作表名称。
list_dfs=[]
TT=Dataframe.groupby(['change','x2'])
for group,name in TT:
list_dfs.append(group)
writer = pd.ExcelWriter('output.xlsx')
for group,name in list_dfs:
list_dfs.to_excel(writer )
writer.save()
writer.close()
它给我以下错误
'list' object has no attribute 'to_excel'
如果我按照groupby的方法进行操作,它会不断显示此错误
'tuple' object has no attribute 'groupby'