I have a zipfile which contains many npy files (file1.npy
, file2.npy
, file3.npy
, ...). I would like to load them individually without extracting the zipfile on a filesystem. I have tried many things but I can't figure it out.
My guess was:
import zipfile
import numpy as np
a = {}
with zipfile.ZipFile('myfiles.zip') as zipper:
for p in zipper.namelist():
with zipper.read(p) as f:
a[p] = np.load(f)
Any ideas?