Concatenation in Numpy
print("Welcome to world of Numpy 💛")Have you thought about how to concatenate Numpy’s arrays? Or you haven’t got any clue! Don’t worry I am here to help you with it 😃.
Before we dive into how to concatenate Arrays using numpy, lets review how we do it normally.
Initially we created two arrays, and assigned them integer values.
Then we created a new array and assign those arrays to it.
That’s how the concatenated list looks as an output.
Let’s see how can we concatenate using Numpy Library!
At the beginning we imported Numpy library, and then created two arrays .
Then we concatenate both array’s using method provided by numpy library “concatenate” and passed the array’s name as Arguments.
Finally arrays are concatenated. But Wait ! Isn’t it too easy?
Indeed it is!
Get Mian’s stories in your inbox
Join Medium for free to get updates from this writer.
Let’s try doing one more time.
Here we created two dimensional numpy arrays and then called function concatenate. Wait till you see the output 😃.
Did you see the magic?
Let me elaborate …
Numpy’s concat function, concatenated two array’s such that array passed as first argument to the function lies on the top of array passed as second array!
That’s how easy it was to concatenate arrays using Numpy.
print("Don't forget to explore it at your own! Good Luck 😉")






