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
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
- Set up notebook
- Import data
- 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.