recover dict from 0-d numpy array
0-d arrays can be indexed using the empty tuple:
>>> import numpy as np
>>> x = np.array({'x': 1})
>>> x
array({'x': 1}, dtype=object)
>>> x[()]
{'x': 1}
>>> type(x[()])
<type 'dict'>
Use mydict.item()
to obtain the array element as a Python scalar.
>>> import numpy as np
>>> np.save('/tmp/data.npy',{'a':'Hi Mom!'})
>>> x=np.load('/tmp/data.npy')
>>> x.item()
{'a': 'Hi Mom!'}