Use Pandas Like Jedi

Small yet functional tips for Pandas

Soner Yıldırım
Towards Data Science

Photo by freestocks on Unsplash

If you are in the field of data science, you must have heard Pandas. It is the most commonly used data analysis and manipulation library.

The functions and methods of Pandas make it very simple and efficient to work with tabular data.

In this post, we will cover 4 small tips that further expedite the data analysis process. Together with the basic operations, these small tips can make you use Pandas like Jedi.

I will do a few examples for each tip so that it is well understood. I will use the grocery and direct marketing datasets available on Kaggle to do examples.

Let’s start by importing Pandas along with NumPy and read the datasets into a dataframe.

import numpy as np
import pandas as pd
groceries = pd.read_csv("/content/Groceries_dataset.csv")
marketing = pd.read_csv("/content/DirectMarketing.csv")

The grocery dataset contains some shopping data. The columns show the member number, date of shopping, and purchased items.

The marketing dataset contains customer and sales information about a marketing campaign.

Tip 1: Inserting a column

Create an account to read the full story.

The author made this story available to Medium members only.
If you’re new to Medium, create a new account to read this story on us.

Or, continue in mobile web

Already have an account? Sign in

Responses (1)

What are your thoughts?

When can we see that e other Jedi based articles on the same or similar subject like Pandas, Numpy etc.