python 知识记录

xiaoxiao2021-02-28  57

>>>temp = ones((3, 1)) #创建数组 >>>temp array([[ 1.], [ 1.], [ 1.]]) >>>weights = mat(w) #转换为numpy矩阵 >>>weights matrix([[ 1.], [ 1.], [ 1.]]) >>>s = weights.getA() #将numpy矩阵转换为数组 >>>s array([[ 1.], [ 1.], [ 1.]]) 123456789101112131415

从上述结果中可以看书getA()函数与mat()函数的功能相反,是将一个numpy矩阵转换为数组

转载请注明原文地址: https://www.6miu.com/read-2619562.html

最新回复(0)