发布时间:2019-09-23 17:02:02编辑:auto阅读(11041)
repeat()函数用法:
np.repeat(3, 4)
array([3, 3, 3, 3])x = np.array([[1,2],[3,4]])
np.repeat(x, 2)
array([1, 1, 2, 2, 3, 3, 4, 4])np.repeat(x, 3, axis=1) #沿着纵轴方向重复,增加列数
array([[1, 1, 1, 2, 2, 2],
[3, 3, 3, 4, 4, 4]])np.repeat(x, [1, 2], axis=0) #沿着横轴方向重复,增加行数,分别为一次和两次
array([[1, 2],
[3, 4],
[3, 4]])
上一篇: Python画3D心形
下一篇: 总结H3CNE学习过程和其他
50970
50352
40967
37834
32299
29191
28077
22906
22868
21199
1062°
1740°
1428°
1361°
1630°
1448°
2106°
3653°
3576°
2526°