我的问题很简单:用于矩阵求逆的 numpy.linalg.inv
和 scipy.linalg.inv
函数之间有什么区别
Scipy 函数只是 Numpy 函数的一个包装器吗?
效率、数值稳定性、速度……我应该更喜欢哪一个?
谢谢 !
最佳答案
来自 the SciPy Documentation你会得到以下信息:
scipy.linalg vs numpy.linalg
scipy.linalg
contains all the functions innumpy.linalg
. plus some other more advanced ones not contained innumpy.linalg
Another advantage of usingscipy.linalg
overnumpy.linalg
is that it is always compiled with BLAS/LAPACK support, while fornumpy
this is optional. Therefore, thescipy
version might be faster depending on hownumpy
was installed.Therefore, unless you don’t want to add
scipy
as a dependency to yournumpy
program, usescipy.linalg
instead ofnumpy.linalg
我希望这有帮助!
关于Numpy 和 Scipy 矩阵求逆函数的区别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32204610/