>>>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矩阵转换为数组