← Back to list

Concatenation in 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 😃.

Mian · 2025-07-28 11:33 · 1 claps · 2.1 min read
#python #numpy #concatenate #arrays #two-dimensional-arrays
Open on Medium ↗

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 😃.

Concatenation

Concatenation

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.

First way of concatenation

First way of concatenation

Second way of concatenation

Second way of concatenation

Then we created a new array and assign those arrays to it.

Concatenated list

Concatenated list

That’s how the concatenated list looks as an output.

Let’s see how can we concatenate using Numpy Library!

Numpy array’s

Numpy array’s

At the beginning we imported Numpy library, and then created two arrays .

concatenate function

concatenate function

Then we concatenate both array’s using method provided by numpy library “concatenate” and passed the array’s name as Arguments.

output

output

Finally arrays are concatenated. But Wait ! Isn’t it too easy?

Indeed it is!

Let’s try doing one more time.

concat function

concat function

Here we created two dimensional numpy arrays and then called function concatenate. Wait till you see the output 😃.

output

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 😉")

메타데이터
post_id
2ea97b290f2f
slug
concatenation-in-numpy-2ea97b290f2f
url
https://medium.com/@buildwithmobi/concatenation-in-numpy-2ea97b290f2f
canonical_url
https://medium.com/@buildwithmobi/concatenation-in-numpy-2ea97b290f2f
author_url
https://medium.com/@buildwithmobi
status
ok
fetched_at
2026-08-09 01:45:40