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

I want to combine them in a way such that I will get,

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

How can I do that?

1
  • You have 2 (2,3) shaped arrays, and want a (2,6). Have you tried np.hstack? Read its docs. Commented Jun 5, 2021 at 17:00

1 Answer 1

1

This has been achieved using np.hstack((a, b))

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.