I want to edit zip file generated by numpy savez function. For example we can make a zip file like
>>> import numpy as np
>>> x = np.array([1,2,3])
>>> y = np.array([4,5,6])
>>> dat = {'/path/to/x': x, '/path/to/y': y}
>>> f = open('foo', 'wb')
>>> np.savez(f, **dat)
This code creates a zip file named foo. (On ubuntu GUI, it is shown as Zip archive type)
Then, I want to remove the file y in the zip file. (Without using Python)
I have tried an approach that first unzip the file and manually remove the file and zip it again. I made a zip file by tar
command, but it generates gzip-compressed tar archive.
What is the correct way to edit and generate zip file generated by numpy save_z?
unzip
then you should checkzip
command. – furas