I'm not familiar with the segy module, but to save to an npz file format, you can use the scipy.parse package to convert a regular nupmy array to a sparse/compressed array.
import scipy.sparse as sp
import numpy as np
dense = np.array(*your np array here*)
sparse = sp.csr_martrix(dense)
sp.save_npz('name.npz', sparse, compressed=True)
This will convert the regular numpy array to be saved as the compressed matrix file in .npz. Therefore, the only problem left is to convert the segy to numpy, which I'm not familiar with.
I'm not familiar with the segy module, but to save to an npz file format, you can use the scipy.parse package to convert a regular nupmy array to a sparse/compressed array.
This will convert the regular numpy array to be saved as the compressed matrix file in .npz. Therefore, the only problem left is to convert the segy to numpy, which I'm not familiar with.