gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-04 14:57:11 26 4
gpt4 key购买 nike

我的问题很简单:用于矩阵求逆的 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/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com