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'Vertical stacking:'
c = np.vstack((a,b))print c
它将产生以下输出 -
First array:[[12][34]]
Second array:[[56][78]]
Vertical stacking:[[12][34][56][78]]