user15962699
user15962699

Reputation:

Element wise array concatenation with numpy

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?

Upvotes: 0

Views: 44

Answers (1)

user15962699
user15962699

Reputation:

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

Upvotes: 1

Related Questions