This is surely a silly mistake, as I was not aware of the dict.copy functionality. The problem is that I had a dictionary full of data, say x
, that I copied to another variable, say y
, by doing y=numpy.copy(x)
. The thing is that later I saved the variable y
and wrote it to a pickle (and I repeated this several times, writing several files; its part of a very long simulation!). Now when I open the pickle, I get an ndarray
object which contains my dictionary but inside a ndarray
object, and I have no idea on how to retrieve the original dictionary with the original data. A working example:
import numpy
x = {'a':[1,2,3], 'b':['foo','bar']}
y = numpy.copy(x)
I have tried lots of things with no success; is there actually a way to retrieve the original dictionary, x
, from the new variable y
?
Thanks in advance for the help!