Home > Statistics > Main text

Basic operations on matrix


Tag: reading, statistics

使用numpy解析线性方程式

例子:

import numpy as np

A = np.array([[2, 1, 1], [1, 3, 2], [1, 0, 0]]) 

B = np.array([4, 5, 6]) 

# linalg.solve is the function of NumPy to solve a system of linear scalar equations
print ("Solutions:\n",np.linalg.solve(A, B ) )

Solutions:
[  6.  15. -23.]


If you link this blog, please refer to this page, thanks!
Post link:https://tsinghua-gongjing.github.io/posts/MSE-vs-scientific-computing.html

Previous: LSTM