I have a data frame, with students ID and names and other information.
I have done a groupby on students ID, I need to create zip file(on student name) for each student and then zip them all.
I have the following code.
I can zip all the csvs, but how can I zip each individually first since thery are in a loop?
What I have tried:
groupby = df.groupby('stu_ID')
for n,g in groupby
csv=g.to_csv(index=false)
with open('{}{}.csv'.format(path,n),'w' as out_file:
out_file.write(csv)
shutil.make_archive('PATH','zip',
'PATH)