How to use Pandas head() and tail() to get the first and last rows

One of the first things you’ll do whenever you import a Pandas dataframe is view the data to check that it’s formatted correctly and see what you’re dealing with. It’s...

How to use append() to add rows to a Pandas dataframe

The Pandas append() function is commonly used for appending or adding new rows to the bottom of an existing Pandas dataframe, or joining or concatenating dataframes vertically. However, while still...

How to prefix or suffix Pandas column names and values

When working with Pandas dataframes it really helps to have clear and consistent naming conventions for column labels or column names, and for the column values themselves. Adding a prefix...

How to find the most common value in a Pandas dataframe column

When working with categorical data in Pandas dataframes, it can help to get an understanding of the number of times a given value appears - a feature called “cardinality.” The...

How to drop Pandas dataframe rows and columns

When working with Pandas dataframes you’ll often need to drop, remove, or delete columns or rows from a dataframe to leave you with a clean dataframe containing tidier data you...

How to calculate Pearson correlation coefficient in Pandas

The Pearson correlation coefficient, or PCC, is the standard statistical method for computing pairwise or bivariate correlation in Pandas. It’s so commonly used in statistics, that it is often referred...

How to classify Google Search Console data in EcommerceTools

ABC analysis originally came from the field of inventory management, where it’s used by procurement staff to classify inventory items into three categories - A, B, and C - to...

How to use Pandas date_range() to create date ranges

Pandas includes some incredible features for working with dates and times. The Pandas date_range() function is used to create a range of dates and can be used to create a...

How to slugify column names and values in Pandas

Slugification is the process of removing non-alphanumeric characters from a string and replacing spaces with underscores. Slugifying data is really useful for data scientists and can be used to both...