How to Join NumPy Arrays Along Columns (axis=0)


In this example, we will learn how to join NumPy arrays along columns(axis=0) in Python.

Source Code

import numpy as np

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

c = np.concatenate((a, b))

print(c)

Output:

[[1 2]
 [3 4]
 [5 6]
 [7 8]]
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
Advertisement