> For the complete documentation index, see [llms.txt](https://yingshaoxo.gitbook.io/university-notes/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://yingshaoxo.gitbook.io/university-notes/high-level-math/linear_algebra.md).

# Linear algebra

## Import `numpy` firstly

```
import numpy as np
```

## Matrix production

![](https://2889346953-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Le4Kw7maZEabKFjsC7z%2F-Lf5hWWAPXrS6pkg310z%2F-Lf5hoDMgN-EK-VL-7Pm%2Fmatrix-multiplication.png?generation=1558112062595575\&alt=media)

```
>>> a = np.array([[2,3,0], [1,2,0]])
>>> b = np.array([[1,0], [0,2], [3,0]])
>>> np.dot(a,b)
array([[2, 6],
       [1, 4]])
```

## Determinant of an array (数组的行列式)

```
>>> b = np.array([[1,-1,0], [4,-5,-3], [2,3,6]])
>>> np.linalg.det(b)
9.0000000000000018
```
