9951 explained code solutions for 126 technologies


python-numpyHow to join 2 Numpy arrays


import numpy as np
a = np.array([1, 2, 3, 4])
b = np.array([5, 6, 7, 8])

joined = np.concatenate((a, b))ctrl + c
import numpy as np

load Numpy module for Python

np.array

declare Numpy array

np.concatenate

joins a sequence of arrays

(a, b)

arrays to join

joined

resulting array of values from joined arrays