>>> import numpy as np
>>> a=([[1,2,3],[4,5,6],[7,8,9]])
>>> a
array([[1, 2, 3],
[4, 5, 6],
[7, 8, 9]])
>>> #a数组的转置直接使用.transpose()函数即可
>>> ()
array([[1, 4, 7],
[2, 5, 8],
[3, 6, 9]])
>>> #求数组的逆
>>> a
array([[ 3., 2., 3.],
[ 4., 7., 6.],
[ 7., 8., 11.]])
>>> (a)
array([[ 0.90625, 0.0625 , -0.28125],
[-0.0625 , 0.375 , -0.1875 ],
[-0.53125, -0.3125 , 0.40625]])
>>> #验证
>>> (a,(a))
array([[ 1.00000000e+00, -2.22044605e-16, 0.00000000e+00],
[ 4.44089210e-16, 1.00000000e+00, 0.00000000e+00],
[-8.88178420e-16, 0.00000000e+00, 1.00000000e+00]])
>>> #Solve the system of equations ``3 * x0 + x1 = 9`` and ``x0 + 2 * x1 = 8``:
>>> a = ([[3,1], [1,2]])#系数数组
>>> a
array([[3, 1],
[1, 2]])
>>> b = ([9,8])#结果
>>> b
array([9, 8])
>>> #求它的解x
>>> x = (a, b)
>>> x
array([2., 3.])
>>> #求数组的行列式值
>>> d
array([[1, 2],
[3, 4]])
>>> #d的逆
>>> f=(d)
>>> f
array([[-2. , 1. ],
[ 1.5, -0.5]])
>>> #d的行列式值
>>> (d)
-2.0000000000000004
>>> (f)
-0.49999999999999967
>>> #数组的迹
>>> d
array([[1, 2],
[3, 4]])
>>> f
array([[-2. , 1. ],
[ 1.5, -0.5]])
>>> (d)
5
>>> (f)
-2.4999999999999996