>>> a = np.array([1, 2, 3])
>>> a = a.reshape(-1, 1) #-1表示任意行数,1表示1列
>>> a
array([[1],
[2],
[3]])
有时候接口会报错,需要reshape一下
>>> a = np.array([1, 2, 3])
>>> a = a.reshape(-1, 1) #-1表示任意行数,1表示1列
>>> a
array([[1],
[2],
[3]])
有时候接口会报错,需要reshape一下
numpy: 1. numpy的属性: 1.T : 转置 li1 = [ [1,2,3], [4,5,6] ] a = np.array(li1) a.T
举报文章
请选择举报类型
补充说明
0/200
上传截图
格式支持JPEG/PNG/JPG,图片不超过1.9M