Numpy 和 Scipy 矩阵求逆函数的区别

标签 numpy scipy

我的问题很简单:用于矩阵求逆的 numpy.linalg.invscipy.linalg.inv 函数之间有什么区别

Scipy 函数只是 Numpy 函数的一个包装器吗?
效率、数值稳定性、速度……我应该更喜欢哪一个?

谢谢 !

最佳答案

来自 the SciPy Documentation你会得到以下信息:

scipy.linalg vs numpy.linalg
scipy.linalg contains all the functions in numpy.linalg. plus some other more advanced ones not contained in numpy.linalg Another advantage of using scipy.linalg over numpy.linalg is that it is always compiled with BLAS/LAPACK support, while for numpy this is optional. Therefore, the scipy version might be faster depending on how numpy was installed.

Therefore, unless you don’t want to add scipy as a dependency to your numpy program, use scipy.linalg instead of numpy.linalg



我希望这有帮助!

关于Numpy 和 Scipy 矩阵求逆函数的区别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32204610/

相关文章:

python - 是否可以更改(更新)已保存在 .npy 文件中的 numpy 数组的条目?如何?

python - ValueError : The truth value of an array with more than one element is ambiguous. 使用 a.any() 或 a.all()

scipy - scipy.sparse.linalg.lsmr和scipy.sparse.linalg.lsqr之间的区别

python - 使用 python 的莫尔斯势拟合和来自 scipy 的曲线拟合

python - Scipy ODE 时间步长倒退

python - Numpy:在一台机器上耗尽内存,而在另一台机器上完成相同的任务

python - Blitz 代码产生不同的输出

python - 从 sklearn 中的高斯混合模型获取 PDF

python - Python3.3的Scipy在哪里下载?

python - 在 cygwin/win7 上安装 scipy