Skip to main content
HomePython

Course

Working with Categorical Data in Python

IntermediateSkill Level
4.8+
2,438 reviews
Updated 07/2025
Learn how to manipulate and visualize categorical data using pandas and seaborn.
Start Course for Free
PythonData Manipulation4 hr15 videos52 Exercises4,200 XP34,337Statement of Accomplishment

Create Your Free Account

or

By continuing, you accept our Terms of Use, our Privacy Policy and that your data is stored in the USA.

Loved by learners at thousands of companies

Group

Training 2 or more people?

Try DataCamp for Business

Course Description

Being able to understand, use, and summarize non-numerical data—such as a person’s blood type or marital status—is a vital component of being a data scientist. In this course, you’ll learn how to manipulate and visualize categorical data using pandas and seaborn. Through hands-on exercises, you’ll get to grips with pandas' categorical data type, including how to create, delete, and update categorical columns. You’ll also work with a wide range of datasets including the characteristics of adoptable dogs, Las Vegas trip reviews, and census data to develop your skills at working with categorical data.

Prerequisites

Data Manipulation with pandas
1

Introduction to Categorical Data

Almost every dataset contains categorical information—and often it’s an unexplored goldmine of information. In this chapter, you’ll learn how pandas handles categorical columns using the data type category. You’ll also discover how to group data by categories to unearth great summary statistics.
Start Chapter
2

Categorical pandas Series

3

Visualizing Categorical Data

In this chapter, you’ll use the seaborn Python library to create informative visualizations using categorical data—including categorical plots (cat-plot), box plots, bar plots, point plots, and count plots. You’ll then learn how to visualize categorical columns and split data across categorical columns to visualize summary statistics of numerical columns.
Start Chapter
4

Pitfalls and Encoding

Lastly, you’ll learn how to overcome the common pitfalls of using categorical data. You’ll also grow your data encoding skills as you are introduced to label encoding and one-hot encoding—perfect for helping you prepare your data for use in machine learning algorithms.
Start Chapter
Working with Categorical Data in Python
Course
Complete

Earn Statement of Accomplishment

Add this credential to your LinkedIn profile, resume, or CV
Share it on social media and in your performance review
Enroll Now

Don’t just take our word for it

*4.8
from 2,438 reviews
82%
16%
2%
0%
0%
  • Kolade
    7 hours ago

  • Sadam
    2 days ago

    good for categorical work on datasets

  • Phyo Aung
    2 days ago

  • Ahmed
    2 days ago

  • Claudia Elizabeth
    2 days ago

  • Tanvir Rubayet
    2 days ago

Kolade

"good for categorical work on datasets"

Sadam

Phyo Aung

FAQs

What Python libraries are used in this course?

You will use pandas for manipulating categorical data and seaborn for creating visualizations of categorical variables.

What datasets are used in the exercises?

You work with data on adoptable dog characteristics, Las Vegas trip reviews, and census data to practice categorical data manipulation and visualization.

What will I learn about the pandas categorical data type?

You will learn to create, update, and delete categorical columns, set and reorder categories, and use the category type to improve memory efficiency.

Is this course suitable for beginners?

This is an intermediate course. You should be comfortable with pandas and intermediate Python before starting.

Why is working with categorical data important?

Almost every dataset contains categorical information like status or type. Knowing how to properly encode and summarize it is essential for accurate analysis and modeling.

Join over 19 million learners and start Working with Categorical Data in Python today!

Create Your Free Account

or

By continuing, you accept our Terms of Use, our Privacy Policy and that your data is stored in the USA.

Grow your data skills with DataCamp for Mobile

Make progress on the go with our mobile courses and daily 5-minute coding challenges.