A matrix is a specialized 2-D array that retains its 2-D nature through operations. It has certain special operators, such as *
(matrix multiplication) and **
(matrix power).
创建方法:
a = np.matrix('1,2; 3,4')
a = np.matrix( [ [ 1,2 ] [ 3,4 ] ] )
使用过的
行列数量 a.shape : (n_rows, n_columns)
统计行、列、整个矩阵 np.min(a, axis = ) max mean sum....
转化为标量 np.asscalar()
基础运算 Matrix Operations:
求逆: a.I
转置: a.T
元素运算 Element wise operation:
np.divide(a)
np.square()
np.sqrt()