In [1]: import numpy as np

In [2]: a = np.array([[1, 2, 3], [4, 5, 6]])

In [3]: b = np.array([[9, 8, 7], [6, 5, 4]])

In [4]: np.concatenate((a, b))
Out[4]: 
array([[1, 2, 3],
       [4, 5, 6],
       [9, 8, 7],
       [6, 5, 4]])

or this:

In [1]: a = np.array([1, 2, 3])

In [2]: b = np.array([4, 5, 6])

In [3]: np.vstack((a, b))
Out[3]: 
array([[1, 2, 3],
       [4, 5, 6]])
Answer from endolith on Stack Overflow
🌐
NumPy
numpy.org › doc › stable › reference › generated › numpy.append.html
numpy.append — NumPy v2.5 Manual
Delete elements from an array. ... Try it in your browser! >>> import numpy as np >>> np.append([1, 2, 3], [[4, 5, 6], [7, 8, 9]]) array([1, 2, 3, ..., 7, 8, 9])
🌐
DataCamp
datacamp.com › doc › numpy › append
NumPy append()
NumPy's `append()` function is used to add elements to the end of an existing array, effectively creating a new array with the additional elements.
🌐
NumPy
numpy.org › doc › 2.3 › reference › generated › numpy.append.html
numpy.append — NumPy v2.3 Manual
Delete elements from an array. ... Try it in your browser! >>> import numpy as np >>> np.append([1, 2, 3], [[4, 5, 6], [7, 8, 9]]) array([1, 2, 3, ..., 7, 8, 9])
🌐
NumPy
numpy.org › doc › 2.1 › reference › generated › numpy.append.html
numpy.append — NumPy v2.1 Manual
Delete elements from an array. ... >>> import numpy as np >>> np.append([1, 2, 3], [[4, 5, 6], [7, 8, 9]]) array([1, 2, 3, ..., 7, 8, 9])
🌐
TutorialsPoint
tutorialspoint.com › numpy › numpy_append.htm
Numpy Append() Method
import numpy as np a = np.array([[1,2,3],[4,5,6]]) print('First array:') print(a) print('\n') print('Append elements to array:') print(np.append(a, [7,8,9])) print('\n') print('Append elements along axis 0:') print(np.append(a, [[7,8,9]],axis = 0)) print('\n') print('Append elements along axis 1:') print(np.append(a, [[5,5,5],[7,8,9]],axis = 1))
🌐
Vultr Docs
docs.vultr.com › python › third-party › numpy › append
Python Numpy append() - Add Elements to Array | Vultr Docs
April 10, 2025 - Plan to append elements to this array. ... Use numpy.append() to add a single element or multiple elements.
🌐
Centron
centron.de › startseite › numpy.append() in python – tutorial
numpy.append() in Python - Tutorial
February 7, 2025 - The numpy.append() function is a versatile way to concatenate arrays in Python. It offers options for flattening arrays and appending along specific axes.
Find elsewhere
🌐
NumPy
numpy.org › doc › 2.2 › reference › generated › numpy.append.html
numpy.append — NumPy v2.2 Manual
Delete elements from an array. ... >>> import numpy as np >>> np.append([1, 2, 3], [[4, 5, 6], [7, 8, 9]]) array([1, 2, 3, ..., 7, 8, 9])
🌐
GeeksforGeeks
geeksforgeeks.org › python › numpy-append-python
numpy.append() in Python - GeeksforGeeks
April 14, 2025 - import numpy as geek arr1 = geek.arange(8).reshape(2, 4) print("2D arr1 :", arr1) print("Shape :", arr1.shape) arr2 = geek.arange(8, 16).reshape(2, 4) print("2D arr2:", arr2) print("Shape :", arr2.shape) arr3 = geek.append(arr1, arr2) print("Appended arr3 by flattened :", arr3) arr3 = geek.append(arr1, arr2, axis = 0) print("Appended arr3 with axis 0 :", arr3) arr3 = geek.append(arr1, arr2, axis = 1) print("Appended arr3 with axis 1 :", arr3) ... When no axis is given both arrays are flattened into a single long 1D array and then joined. When axis=0 rows from the second array are added below the first. With axis=1 columns are added to the right side of the first array. numpy.append() function is used to extend a array and it creates a new array rather than modifying the original one.
🌐
Note.nkmk.me
note.nkmk.me › home › python › numpy
NumPy: append() to add values to an array | note.nkmk.me
February 4, 2024 - NumPy: Join arrays with np.concatenate, block, vstack, hstack, etc. The approach for three-dimensional and higher-dimensional arrays follows the same principle. By default (axis=None), the array is flattened to one dimension before being added to the end. a_3d = np.arange(12).reshape(2, 3, 2) print(a_3d) # [[[ 0 1] # [ 2 3] # [ 4 5]] # # [[ 6 7] # [ 8 9] # [10 11]]] print(np.append(a_3d, 100)) # [ 0 1 2 3 4 5 6 7 8 9 10 11 100]
🌐
DigitalOcean
digitalocean.com › community › tutorials › python-add-to-array
Python Array Add: How to Append, Extend & Insert Elements | DigitalOcean
June 11, 2026 - To add to an array in Python, you append, extend, or insert elements depending on the structure you use. Most tutorials mean a Python list when they say “array.” For typed numeric storage, use the stdlib array module. For math on multi-dimensional data, use NumPy.
🌐
NumPy
numpy.org › doc › stable › reference › generated › numpy.concatenate.html
numpy.concatenate — NumPy v2.5 Manual
When one or more of the arrays to be concatenated is a MaskedArray, this function will return a MaskedArray object instead of an ndarray, but the input masks are not preserved.
🌐
AskPython
askpython.com › python › array › append-an-array-in-python
How to append an Array in Python? - AskPython
April 19, 2026 - unicode: It represents the type of elements to be occupied by the array. For example, ‘d’ represents double/float elements. Further, the append() function operates in the same manner as that with Python Lists. ... The NumPy module can be used to create an array and manipulate the data against various mathematical functions.
🌐
w3resource
w3resource.com › numpy › manipulation › append.php
Numpy: numpy.append() function - w3resource
April 25, 2026 - Adding Rows or Columns: Users can add new rows or columns to an existing array, expanding its dimensions as needed. Flexible Usage: The function accepts both single elements and arrays as input for appending, offering versatility in array manipulation. Out-of-Place Operation: numpy.append() performs an out-of-place operation, meaning it creates and returns a new array with appended values without modifying the original array.
🌐
GeeksforGeeks
geeksforgeeks.org › python › how-to-append-two-numpy-arrays
How to append two NumPy Arrays? - GeeksforGeeks
July 23, 2025 - Return : [ndarray] The concatenated array. ... import numpy array1 = numpy.array([1, 2, 3, 4, 5]) array2 = numpy.array([6, 7, 8, 9, 10]) # Appending both Arrays using concatenate() method.
🌐
Programiz
programiz.com › python-programming › numpy › methods › append
NumPy append()
import numpy as np array1 = np.array([0, 1, 2, 3]) array2 = np.array([4, 5, 6, 7]) # append values to an array array3 = np.append(array1, array2) print(array3)