![](/img/trans.png)
[英]What is the R equivalent of the solve_ivp() function in Python?
[英]Python equivalent function of solve() in R
我可以在 Python 中使用什么等效的函數來等效於 R 中的solve()
?
在 R 中,如果我調用solve(a, b)
,它將返回x
,如a*x = b
其中a
是我的協方差矩陣。
嘗試np.linalg.solve
:
>>> a = np.array([[1, 2], [3, 5]])
>>> b = np.array([1, 2])
>>> x = np.linalg.solve(a, b)
>>> x
array([-1., 1.])
> solve(matrix(c(1,2,3,5), 2, 2, byrow = TRUE), c(1, 2))
[1] -1 1
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.