Working with Categorical Data in Python

Start Free Preview

Buying via our links supports this free directory · Affiliate disclosure.
Course facts
  • Payment: Free Preview (Paid Upgrade)
  • Learning style: Self-paced, start anytime
  • Format: Text & Interactive
  • Video access: Streaming Only
  • Before you start: Data Manipulation with pandas
DataCamp details
  • Chapters: 4
Created byDataCamp
Available onDataCamp

Course Details
Learning Style

Start Anytime

Level

Intermediate

Study Mode

100% Online

Duration

Short (< 10 Hours)

Languages
Audio Language

English

Outcomes
Certificate

Certificate of Completion

Price & Terms
Pricing Model

Free Preview (Paid Upgrade)

Technical
Content Medium

Text & Interactive

Video Access

Streaming Only

Specification
Access

Subscription

SKU: working-categorical-data-python Category: Tags: , Brand:

Learn to store, clean, reorder, plot and encode categorical columns in Python with the pandas category type, seaborn charts and one-hot encoding.

At a glance
Duration4 hrs
LevelIntermediate
CertificateCertificate of Completion
LanguageEnglish
Taught byKasey Jones
AccessSubscription
Add your review
Add to wishlistAdded to wishlistRemoved from wishlist 0
Add to compare

Columns that hold labels such as blood type or marital status turn up in nearly every dataset, and they carry common pitfalls when treated like ordinary text. You learn to store these columns with the pandas category type, keep their categories tidy and in a useful order, summarize them with grouped statistics, chart them with seaborn, and turn them into numeric codes that machine learning algorithms can read.

What You Will Achieve

  • Convert label columns to the category dtype when reading a file or creating a Series, and check the memory it saves
  • Clean messy label values and filter a DataFrame on its categories without breaking the column’s type
  • Compare numerical summaries across groups with seaborn box, bar, point and count charts
  • Prepare categorical variables for machine learning with label or one-hot codes and reuse a saved mapping


Program Overview

Categorical Data Types and Grouping in pandas

Sets out what makes a variable categorical and how pandas stores and summarizes it.

  • Categorical vs. numerical and ordinal variables
  • The category dtype and memory savings
  • Setting dtypes while reading data
  • .groupby() summaries by category

Managing Categories in a pandas Series

Works on the categories themselves, then applies the changes to clean and access data in a DataFrame.

  • Setting, adding and removing categories
  • Updating, renaming and collapsing categories
  • Reordering categories before grouping
  • Cleaning variables and filtering data

Seaborn Plots, Pitfalls and Encoding

Charts categorical columns with seaborn, then turns to common mistakes and the encodings used before modeling.

  • Box, bar, point and count plots with catplot()
  • Hue, category order and one plot per group
  • String issues and NumPy array pitfalls
  • Label, Boolean and one-hot encoding

Certificate Awarded (Paid)


Job Outlook

Handling categorical columns well is part of everyday data analysis and data science work, where survey, census and review data are summarized, charted and encoded before they reach machine learning models.


Our take

Good for: Python users who already work with DataFrames and keep meeting label columns that need cleaning, ordering, charting or encoding.

Keep in mind: Exercises run on pandas and seaborn, and the encoding lessons, label and one-hot, stop at preparing columns for machine learning algorithms.

Bottom line: A tight focus on one pandas data type, with enough seaborn charting and encoding practice to carry categorical columns through an analysis.

Frequently Asked Questions

What kinds of data are the exercises built on?

The practice data includes characteristics of adoptable dogs, reviews of trips to Las Vegas and census records.

Why store a column as the category type?

The opening chapter shows that keeping labels in the category dtype can save memory, and how to set that type when reading data or building a Series so later grouping and reordering rely on it.

What pitfalls with categorical columns are covered?

The final chapter looks at common mistakes, including string issues and the use of NumPy arrays with categorical values, and includes a knowledge check on memory usage before moving on to encoding.

User Reviews

0.0 out of 5
★★★★★
0
★★★★★
0
★★★★★
0
★★★★★
0
★★★★★
0

No reviews yet. Be the first to review this course.

There are no reviews yet.

Write your review

Reviews can only be posted by registered learners. Log in, then you will return here to post.

×

    Report this page
    Working with Categorical Data in Python
    Working with Categorical Data in Python
    LiveTalent
    Logo
    Compare items
    • Total (0)
    Compare
    0