module 'numpy' has no attribute 'matrix'
时间: 2023-11-05 13:05:18
浏览: 552

基于Python Numpy的数组array和矩阵matrix详解
[module](https://wenku.csdn.net/doc/6412b6dbbe7fbd1778d483be?spm=1055.2569.3001.10083) '[numpy](https://wenku.csdn.net/doc/6412b6ecbe7fbd1778d48761?spm=1055.2569.3001.10083)' has no [attribute](https://wenku.csdn.net/doc/64631309543f8444889abd37?spm=1055.2569.3001.10083) '[matrix](https://wenku.csdn.net/doc/6ko86bao98?spm=1055.2569.3001.10083)' 这个错误通常是由于numpy版本问题导致的。numpy库在较新版本中已经将matrix函数移除了,因此在较新的numpy版本中无法使用matrix函数。解决这个问题的方法是可以使用其他替代的函数来代替matrix函数,例如使用numpy.array来创建矩阵。如果你需要使用matrix函数的特定功能,可以尝试降低numpy的版本或者查找其他可用[的解决方案](https://wenku.csdn.net/doc/6401aba9cce7214c316e90b5?spm=1055.2569.3001.10083)。
阅读全文
相关推荐


















