如果你使用 python2.7,我这里有打包好的 安装文件
常用函数
import numpy as np
np.array([[1,2,3],[4,5,6]]) # 定义一个二维数组
np.mat(...[[1,2,3],[4,5,6]]) # 定义一个两行三列矩阵
np.mat(list) # 列表或者数组转 matrix(矩阵)
np.tolist(matrix) # 与上面相反
np.shape(...array) # 求矩阵或者数组array的维度
array.reshape(m,n) # 数组或矩阵重塑为m行n列
np.eye(m,n) # 创建m行n列单位矩阵
np.zeros([m,n],dtype...12的列表,,再重塑为4行3列的矩阵
list1 = [0,1,2,3,4,5,6,7,8,9,0,1]
list1_to_mat = np.mat(list1) # 列表先转成矩阵
mat1 = list1...3行4列的数组转成矩阵,和上面矩阵相乘
array1 = np.array([[1,2,3,4],[4,5,6,7],[3,2,1,0]])
mat2 = np.mat(array1)
print(mat2