python - Can't write dataframe to excel after using groupby function in pandas -


import excel file dataframe:

import pandas pd  importexcelalldataflow =pd.read_excel("tmespatialfromcenter.xlsx")  aa=importexcelalldataflow.groupby(['source', 'timeflowcontext']).size() 

i want write "aa" dataframe excel. used following code it. doesn't work.

timespatialcount.to_excel(timespatialcount.xlsx, sheet_name='sheet1' header=false) 

could please tell me right way write this?

thanks in advance.

i want write "aa" dataframe excel.

presumably means want write:

aa.to_excel("timespatialcount.xlsx", sheet_name='sheet1' header=false) 

you write dataframe aa file "timespatialcount.xls".


Popular posts from this blog