np.repeat() 用法
1.单词repeat:重复相关的词义2.使用np.repeat(1, 5)array([1, 1, 1, 1, 1])# 1 重复5次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]])# 将重复操作施加到 维度‘axis=1’上,相当
复制链接