I usually save data in npz files in python. How to write a function which loads the npz file and automatically creates arrays which are present in the .npz file. For example, say there are three arrays A, B, and C in a file named some_data.npz.
What I want the function to do is load the npz file as
data1 = np.load('some_data.npz')
and then automatically create three arrays named data1A, data1B and data1C which stores the arrays A, B, and C from the original .npz file. How to do this?
numpy.loadfunction already give you a dictionary of arrays? If you just want to bind each individual array to some fancy names, just assign them. Possibly, write a class and make the three names class attributes.