I wanted to make multiple sheets in excel using python pandas.df has the data which i wanted to write in excel using excel writer in python pandas. The column 'Data frame' has different values and wanted to make sheets based on the comparing the values. I wrote the code as given below :
'''
'with pd.ExcelWriter('output3.xlsx') as writer:'
df[df["Data frame"]==0].to_excel(writer,sheet_name='zero')
df[df["Data frame"]==1].to_excel(writer,sheet_name='one')
'''
but I am getting error message as follows:
'''
File "<ipython-input-11-e151f874b16f>", line 3
df[df["Data frame"]==1].to_excel(writer,sheet_name='one')
^
SyntaxError: invalid syntax
'''
can anyone please help me on this.