I'm trying to save a bunch of numpy arrays keyed by the absolute file path that the data came from using savez. However, when I use load to retrieve that data the leading slashes have been removed from the keys.
>>> import numpy as np
>>> data = {}
>>> data['/foo/bar'] = np.array([1, 2, 3])
>>> data.keys()
['/foo/bar']
>>> np.savez('/tmp/test', **data)
>>> data2 = np.load('/tmp/test.npz')
>>> data2.keys()
['foo/bar']
Is this behavior expected from numpy.savez? Is there a workaround or am I doing something wrong?