开发者

Loading and saving numpy matrix

开发者 https://www.devze.com 2022-12-11 13:25 出处:网络
I\'m having troubles loading a numpy matrix. I successfully saved it to disk through: self.q.dump(fileName)

I'm having troubles loading a numpy matrix. I successfully saved it to disk through:

self.q.dump(fileName)

a开发者_如何转开发nd now I want to be able to load it. From what I understand, the load command should do the trick:

self.q.load(fileName)

but it seems not. Anyone knows what might be wrong? Maybe the function is not called load?


help(numpy.ndarray)

 |  dump(...)
 |      a.dump(file)
 |      
 |      Dump a pickle of the array to the specified file.
 |      The array can be read back with pickle.load or numpy.load.
 |      
 |      Parameters
 |      ----------
 |      file : str
 |          A string naming the dump file.

numpy.load should work fine.

0

精彩评论

暂无评论...
验证码 换一张
取 消