numpy 常见数据

np.expand_dims(a,0).repeat(1000,axis=0)

np.tile

shift_point = shift_point * scale

a=[1,2]
>>> np.tile(a,5)
array([1, 2, 1, 2, 1, 2, 1, 2, 1, 2])
>>> np.repeat(a,5)
array([1, 1, 1, 1, 1, 2, 2, 2, 2, 2])
>>> np.expand_dims(a,0).repeat(5,axis=0)
array([[1, 2],
       [1, 2],
       [1, 2],
       [1, 2],
       [1, 2]])
>>> np.expand_dims(a,0).repeat(1000,axis=0)
array([[1, 2],
       [1, 2],
       [1, 2],
       ...,
       [1, 2],
       [1, 2],
       [1, 2]])

你可能感兴趣的:(python,module)