A Simple Example for numpy.append

Here is a simple example for how to use numpy.append function.

import numpy as np
np.append([1, 2, 3], [[4, 5, 6], [7, 8, 9]])

The result is:

array([1, 2, 3, 4, 5, 6, 7, 8, 9])

When axis is specified, values must have the correct shape.

import numpy as np
np.append([[1, 2, 3], [4, 5, 6]], [[7, 8, 9]], axis=0)

the result is:

array([[1, 2, 3],
       [4, 5, 6],
       [7, 8, 9]])