I am using numpy savez as recommended to save numpy arrays. As keys I use the names of the files I have loaded the data from. But it seems like savez
is trying to use the filenames somehow. What should I do? I would like to avoid stripping the file names of their path and ending.
>>> import numpy
>>> arrs = {'data/a.text': numpy.array([1,2]),
'data/b.text': numpy.array([3,4]),
'data/c.text': numpy.array([5,6])}
>>> numpy.savez('file.npz', **arrs)
Traceback (most recent call last):
File "<input>", line 1, in <module>
File "/usr/lib/python2.6/dist-packages/numpy/lib/io.py", line 305, in savez
fid = open(filename,'wb')
IOError: [Errno 2] No such file or directory: '/tmp/data/c.text.npy'