import numpy as np
a = np.array([[1,2],[3,4]])print'First array:'print a
print'\n'
b = np.array([[5,6],[7,8]])print'Second array:'print b
print'\n'print'Horizontal stacking:'
c = np.hstack((a,b))print c
print'\n'
它将产生以下输出 -
First array:[[12][34]]
Second array:[[56][78]]
Horizontal stacking:[[1256][3478]]