python 数据处理 数组拼接concatenate

输入:

import numpy as np
x = [[1, 2], 
     [3, 4]]
x1 = np.concatenate([x, x], axis=0)
print("x1 axis=0")
print(x1)
x2 = np.concatenate([x, x], axis=1)
print("x2 axis=1")
print(x2)

输出:

x1 axis=0
[[1 2]
 [3 4]
 [1 2]
 [3 4]]
x2 axis=1
[[1 2 1 2]
 [3 4 3 4]]

你可能感兴趣的:(Python,numpy,python,numpy,concatenate)