加载和保存numpy矩阵

2024-04-25 19:52:31 发布

您现在位置:Python中文网/ 问答频道 /正文

我在加载numpy矩阵时遇到了问题。我通过以下方式成功地将其保存到磁盘:

self.q.dump(fileName)

现在我希望能够加载它。据我所知,load命令应该能做到:

^{pr2}$

但似乎不是。有人知道可能出了什么问题吗?也许这个函数不叫load?在


Tags: 函数命令selfnumpy方式load矩阵filename
1条回答
网友
1楼 · 发布于 2024-04-25 19:52:31
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应该可以正常工作。在

相关问题 更多 >