当groupby后以下代码可正常运行
groups=db_xl.groupby(fenzu1)#db_xl为一个DataFrame
for name,group in groups:
filename=wb_sta.cell(i,1).value+'_OZON.xlsx'
group.to_excel(filename,index=False)
以下代码报错
for group in groups:
filename=wb_sta.cell(i,1).value+'_OZON.xlsx'
group.to_excel(filename,index=False)
Traceback (most recent call last):
File "c:/lxb/daqi2/divide.py", line 91, in <module>
group.to_excel(filename,index=False)
AttributeError: 'tuple' object has no attribute 'to_excel'