vstack and hstack in numpy code example
Example 1: np vstack
>>> a = np.array([1, 2, 3])
>>> b = np.array([2, 3, 4])
>>> np.vstack((a,b))
array([[1, 2, 3],
[2, 3, 4]])
>>> a = np.array([[1], [2], [3]])
>>> b = np.array([[2], [3], [4]])
>>> np.vstack((a,b))
array([[1],
[2],
[3],
[2],
[3],
[4]])
Example 2: np.hstack
a = np.array([1], [2], [3])
b = np.array([4], [5], [6])
c = np.hstack((a, b)))
print(c)
Example 3: np.vstack python
import numpy as np
a = np.array([1, 2, 3])
b = np.array([2, 3, 4])
np.vstack((a,b))