Skip to content

Instantly share code, notes, and snippets.

@amitness
Created March 6, 2022 13:58
Show Gist options
  • Save amitness/a525a5c1a29493be67c74bb1990683bd to your computer and use it in GitHub Desktop.
Save amitness/a525a5c1a29493be67c74bb1990683bd to your computer and use it in GitHub Desktop.
zipfile add files
from zipfile import ZipFile
for annotator, subset in annotation_df.groupby('annotator'):
with ZipFile(f'{annotator}.zip', 'w') as z:
for path in subset['image_path']:
z.write(path, os.path.basename(path))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment