import numpy as np
#行合并
a = np.arange(6).reshape(2,3)
b = np.random.randint(10,20,size=(4,3))
print(a)
print(b)
print('****************************************')
print(np.concatenate([a,b]))
print('****************************************')
print(np.vstack([a,b]))
print('****************************************')
print(np.row_stack([a,b]))
print('----------------------------------------------------------------------------------------------------')
#列合并
a = np.arange(6).reshape(3,2)
b = np.random.randint(10,20,size=(3,3))
print(a)
print(b)
print('****************************************')
print(np.concatenate([a,b],axis=1))
print('****************************************')
print(np.hstack([a,b]))
print('****************************************')
print(np.column_stack([a,b]))
标签:07,random,合并,np,print,操作,size
From: https://www.cnblogs.com/lyc2001/p/17062969.html