The .npz
file format is used to save several numpy arrays into a single zipped file.
Documentation.
import numpy as np
a = np.array([42])
b = np.array([2, 3, 5, 7, 9])
with open("foo.npz", "wb") as f:
np.savez(f, a, b)
The .npz
file can be unzipped to get .npy
files for each array.
unzip foo.npz