Q:

Write a NumPy program to concatenate two 2-dimensional arrays

0

Write a NumPy program to concatenate two 2-dimensional arrays.
Sample arrays: ([[0, 1, 3], [5, 7, 9]], [[0, 2, 4], [6, 8, 10]]

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

import numpy as np
a = np.array([[0, 1, 3], [5, 7, 9]])
b = np.array([[0, 2, 4], [6, 8, 10]])
c = np.concatenate((a, b), 1)
print(c)

Sample Output:

[[ 0  1  3  0  2  4]                                                   
 [ 5  7  9  6  8 10]]

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now