import numpy as np arr1 = np.arange(8).reshape(2, 4) arr2 = np.arange(10).reshape(2, 5) np.savez('mat.npz', name1=arr1, name2=arr2) data = np.load('mat.npz') print data['name1'] print data['name2']