While working on a data project, I needed to merge multiple arrays into a single one. At first, I thought it would be simple, but I quickly realized there are many different ways to do it in Python, depending on the type of array I was working with.
Over the years, as a Python developer, I’ve used array concatenation in data analysis, machine learning, and even in automation scripts. It’s one of those operations you’ll use often, so it’s worth knowing the different methods and when to use each.
In this tutorial, I’ll show you seven simple ways to concatenate arrays in Python. I’ll start with the built-in approaches and then move on to NumPy.
Concatenation in Python
Concatenation simply means joining two or more arrays into a single array.
For example, if I have:
arr1 = [1, 2, 3]
arr2 = [4, 5, 6]Concatenating them gives me:
[1, 2, 3, 4, 5, 6]That’s the basic idea. Now, let’s look at the different methods to achieve this in Python.
Method 1 – Use the + Operator
The simplest way to concatenate Python arrays (lists in Python) is by using the + operator.
Here’s an example:
arr1 = [10, 20, 30]
arr2 = [40, 50, 60]
result = arr1 + arr2
print(result)Output:
[10, 20, 30, 40, 50, 60]I executed the above example code and added the screenshot below.

I often use this when I just need a quick merge of two lists. It’s clean and easy to read.
Method 2 – Use the extend() Method
Another way is to use the extend() method, which modifies the original list.
arr1 = [100, 200, 300]
arr2 = [400, 500, 600]
arr1.extend(arr2)
print(arr1)Output:
[100, 200, 300, 400, 500, 600]I executed the above example code and added the screenshot below.

Notice that this changes arr1 directly. I use this when I don’t need to keep the original array unchanged.
Method 3 – Use a Loop
Sometimes, especially when working with custom objects, I prefer to use a loop.
arr1 = ["New York", "Chicago"]
arr2 = ["Los Angeles", "Houston"]
for city in arr2:
arr1.append(city)
print(arr1)Output:
['New York', 'Chicago', 'Los Angeles', 'Houston']I executed the above example code and added the screenshot below.

This method is slower for large datasets, but it gives me more control if I need to add conditions while merging.
Method 4 – Use NumPy concatenate()
When working with numerical data, NumPy is the go-to library. It has a built-in concatenate() function.
import numpy as np
arr1 = np.array([1, 2, 3])
arr2 = np.array([4, 5, 6])
result = np.concatenate((arr1, arr2))
print(result)Output:
[1 2 3 4 5 6]I executed the above example code and added the screenshot below.

This is my preferred method when I’m working with scientific or machine learning data.
Method 5 – Use NumPy hstack() and vstack()
NumPy also provides hstack() (horizontal stack) and vstack() (vertical stack).
Horizontal Stack Example
arr1 = np.array([1, 2, 3])
arr2 = np.array([4, 5, 6])
result = np.hstack((arr1, arr2))
print(result)Output:
[1 2 3 4 5 6]Vertical Stack Example
arr1 = np.array([[1, 2, 3]])
arr2 = np.array([[4, 5, 6]])
result = np.vstack((arr1, arr2))
print(result)Output:
[[1 2 3]
[4 5 6]]I use hstack when I want to merge arrays side by side, and vstack when I want to stack them on top of each other.
Method 6 – Use NumPy stack()
Python’s stack() function lets you add a new dimension while concatenating.
arr1 = np.array([1, 2, 3])
arr2 = np.array([4, 5, 6])
result = np.stack((arr1, arr2), axis=0)
print(result)Output:
[[1 2 3]
[4 5 6]]This is useful when I want to create a 2D array from two 1D arrays.
Method 7 – Use itertools.chain()
Finally, Python’s itertools module has a chain() function that works like concatenation.
from itertools import chain
arr1 = [1, 2, 3]
arr2 = [4, 5, 6]
arr3 = [7, 8, 9]
result = list(chain(arr1, arr2, arr3))
print(result)Output:
[1, 2, 3, 4, 5, 6, 7, 8, 9]I use this when I want to concatenate multiple arrays without creating intermediate lists.
Which Method Should You Use?
- If you’re working with small lists, use
+or extend(). - If you need performance with numbers, go with NumPy (concatenate, hstack, vstack).
- If you’re combining many lists, itertools.chain() is memory-efficient.
Practical Example: Combine Sales Data from Multiple States
Let’s say I’m analyzing sales data from different states in the USA. Each state’s data is in an array, and I want to combine them into one.
import numpy as np
california_sales = np.array([1200, 1500, 1600])
texas_sales = np.array([1100, 1300, 1250])
florida_sales = np.array([1000, 1150, 1400])
all_sales = np.concatenate((california_sales, texas_sales, florida_sales))
print("Combined Sales Data:", all_sales)Output:
Combined Sales Data: [1200 1500 1600 1100 1300 1250 1000 1150 1400]This is a real-world scenario where array concatenation makes reporting and analysis much easier.
Most of the time, I find myself using NumPy’s concatenate() or hstack() because they are fast and reliable. But it’s good to know all the different methods, because sometimes the simplest solution (+ operator) is all you need.
Once you start working with larger datasets, especially in data science or machine learning projects, you’ll appreciate the efficiency of NumPy.
You may like to read:
- Remove None Values from a List in Python
- Find the Largest Number in a List Using Python
- Divide Each Element in a List by a Number in Python
- Find the Closest Value in a List Using Python

I am Bijay Kumar, a Microsoft MVP in SharePoint. Apart from SharePoint, I started working on Python, Machine learning, and artificial intelligence for the last 5 years. During this time I got expertise in various Python libraries also like Tkinter, Pandas, NumPy, Turtle, Django, Matplotlib, Tensorflow, Scipy, Scikit-Learn, etc… for various clients in the United States, Canada, the United Kingdom, Australia, New Zealand, etc. Check out my profile.