When trying to sort an Inf object as defined in numpy (I think) dumping goes Ok, but loading fails:
>>> cPickle.dump(Inf, file("c:/temp/a.pcl",'wb'))
>>> cPickle.load(file("c:/temp/a.pcl",'rb'))
Traceback (most recent call last):
File "<pyshell#257>", line 1, in <module>
cPickle.load(file("c:/temp/a.pcl",'rb'))
ValueError: could not convert string to float
>>> type(Inf)
<type 'float'>
Why? And what's more, is there a way to fix this? I want to pickle something that has Inf in it - changing it to something else will remove the grace of the program ...
thanks
source
share