Sitemap
Image by Anja-#pray for ukraine# #helping hands# stop the war from Pixabay

Member-only story

How to use Python’s equivalent of Excel’s CONCATENATE Function

Documentation for concatenating two or more string columns, using Python, Pandas, and Jupyter notebook

3 min readMar 17, 2022

--

If you’re an Excel user, you’re likely familiar with the process of joining several different string columns with either CONCATENATE or a simple series of “&” statements.

We can do this exact same thing in our Jupyter notebook with Python and Pandas.

Let me show you how.

p.s. the header image was chosen because technology tutorial imagery selection is not straightforward, and I like that “cat” appears in “CONCATENATE”.

Table of Contents

  1. Set up notebook
  2. Import data
  3. Concatenate!

Step 1: Set up notebook

First, let’s get a new notebook open and import pandas:

import pandas as pd

Dang, that was easy.

Step 2: Import some data

It’s going to be hard to share an example of how concatenation works without some data. Let’s get some data and then do something with it.

--

--

David Allen
David Allen

Written by David Allen

Documentation and tutorials on Python, Pandas, Jupyter Notebook, and Data Analysis.

No responses yet