December 2017
Intermediate to advanced
386 pages
10h 42m
English
The savez() function allows for the saving of several arrays in the same file. In the following code, we generate arrays with random data and store them to the disk:
x = np.random.rand(200, 300)y = np.random.rand(30)z = np.random.rand(10, 5, 7)np.savez('arrays_xyz.npz', xfile=x, yfile=y, zfile=z)
This code performs the following steps:
Since the generated archive is a ZIP file, it can be opened with any standard archiving utility. ...
Read now
Unlock full access