Click here to Skip to main content
15,745,574 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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
with open('{}{}.csv'.format(path,n),'w' as out_file:

Updated 7-Nov-19 5:43am

1 solution

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900