Beyond the Numbers with Python Pandas



Original Source Here

Beyond the Numbers with Python Pandas

How to handle textual data.

Photo by Samantha Gades on Unsplash

Pandas is one of the most widely-used Python libraries. It provides numerous functions and methods to perform efficient data analysis and manipulation.

We tend to associate tabular data with numbers. However, a substantial amount of raw data comes in textual form. Thankfully, Pandas has several methods to manipulate textual data.

The methods to manipulate strings can be accessed via the str accessor. In this article, we will go over examples to explore these methods.

Let’s start by creating a sample data frame with mock data.

import pandas as pddf = pd.DataFrame({   "FirstName": ["Jane","john","Ashley", "MATT", "Alex"],
"LastName": ["Doe", "Smitt", "Adams", "Tull", "Morgan"],
"Address": ["Houston, TX", "Dallas, TX", "San Antonio, TX",
"Palo Alto, CA", "San Diego, CA"]
})df
(image by author)

AI/ML

Trending AI/ML Article Identified & Digested via Granola by Ramsey Elbasheer; a Machine-Driven RSS Bot

%d bloggers like this: