I cant imagine this question wasnt asked before but im not able to find the answere here: I got a Excel-File as Dataframe and used Dataframe.groupby on it. Now I want to save every single group into ONE new Excel file using a DIFFERENT Sheet for every Group. All I was able to do is creating a lot new files with one group in every file. My new "solution" does nothing.
df = pd.read_excel(file)
neurons = df.groupby("Tags")
#writing Keys into a list
tags = neurons.groups.keys()
tags = list(tags)
for keyInTags in tags:
cells = group.get_group(keyInTags)
cells.to_excel("final.xlsx", sheet_name=keyInTags)
I get no errors but also not new file or writing to an existing file.
tagsis probably empty.