2
a1=array([[0, 1, 2, 3, 4],
   [5, 6, 7, 8, 9]])
a2=array([[0, 1],
   [2, 3]])
a3 = array([[0, 1, 2, 3, 4, 0, 1],
   [5, 6, 7, 8, 9, 2, 3]])

I have two arrays a1,a2,I want to merge them together.the result is a3

2

2 Answers 2

1

Using numpy np.concatenate() this way should work

 a3 = np.concatenate((a1,a2),axis = 1)
Sign up to request clarification or add additional context in comments.

Comments

1

np.c_[a1, a2]

also a np.r_ for row-wise merging.

Comments

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.