快速创建数组
import numpy as np
# 返回符合正态分布的数组
np.random.randn(10)
array([-0.05382978, 0.57450604, 0.08319436...1.54601915, 0.6517896 ,
-1.31985884, -0.68791036, 2.4913952 , 0.31322135, 0.83022095])
# 返回指定范围的一个随机数...0.85714286, 3. ],
[ inf, 2.5 , 3.5 , 0.42857143, 0.125 ]])
# 创建矩阵...array([[3, 2, 8, 8, 8],
[9, 4, 1, 4, 4],
[5, 4, 6, 6, 3],
[6, 5, 7, 3, 1]])
# 数组转矩阵...matrix([[3, 2, 8, 8, 8],
[9, 4, 1, 4, 4],
[5, 4, 6, 6, 3],
[6, 5, 7, 3, 1]])
矩阵的运算