||
分开切片的意思!!
举例说明:
(1)例子1
xx = np.array([1,2,3,4,5,6])
xx[:,None] #挺重要的
输出:
array([[1],
[2],
[3],
[4],
[5],
[6]])
xx[:]
输出:array([1, 2, 3, 4, 5, 6])
(2)例子2
xx = np.array([[1,2,3],[4,5,6]])
xx[:,None] #挺重要的
输出:
array([[[1, 2, 3]],
[[4, 5, 6]]])
xx[:]
输出:
array([[1, 2, 3],
[4, 5, 6]])
点滴分享,福泽你我!Add oil!
Archiver|手机版|科学网 ( 京ICP备07017567号-12 )
GMT+8, 2024-9-1 07:16
Powered by ScienceNet.cn
Copyright © 2007- 中国科学报社