1A= [[1, 2, 3], [4, 5, 6]]
2np.append(A, [[7, 8, 9]], axis=0)
3
4 >> array([[1, 2, 3],
5 [4, 5, 6],
6 [7, 8, 9]])
7#or
8np.r_[A,[[7,8,9]]]
1>>> import numpy as np
2>>> np.append([[0, 1, 2], [3, 4, 5]],[[6, 7, 8]], axis=0)
3array([[0, 1, 2],
4 [3, 4, 5],
5 [6, 7, 8]])
1>>> np.append([[1, 2, 3], [4, 5, 6]], [[7, 8, 9]], axis=0)
2array([[1, 2, 3],
3 [4, 5, 6],
4 [7, 8, 9]])
5>>> np.append([[1, 2, 3], [4, 5, 6]], [7, 8, 9], axis=0)
6Traceback (most recent call last):
7 ...
8ValueError: all the input arrays must have same number of dimensions, but
9the array at index 0 has 2 dimension(s) and the array at index 1 has 1
10dimension(s)
11