Manipulating DataFrames with pandas

You will learn how to tidy, rearrange, and restructure your data using versatile pandas DataFrames.

Start Course for Free
4 Hours19 Videos75 Exercises91,205 Learners
6300 XP

Create Your Free Account



By continuing, you accept our Terms of Use, our Privacy Policy and that your data is stored in the USA. You confirm you are at least 16 years old (13 if you are an authorized Classrooms user).

Loved by learners at thousands of companies

Course Description

In this course, you'll learn how to leverage pandas' extremely powerful data manipulation engine to get the most out of your data. You’ll learn how to drill into the data that really matters by extracting, filtering, and transforming data from DataFrames. The pandas library has many techniques that make this process efficient and intuitive. You will learn how to tidy, rearrange, and restructure your data by pivoting or melting and stacking or unstacking DataFrames. These are all fundamental next steps on the road to becoming a well-rounded data scientist, and you will have the chance to apply all the concepts you learn to real-world datasets.

  1. 1

    Extracting and transforming data


    In this chapter, you will learn how to index, slice, filter, and transform DataFrames using a variety of datasets, ranging from 2012 US election data for the state of Pennsylvania to Pittsburgh weather data.

    Play Chapter Now
    Indexing DataFrames
    50 xp
    Index ordering
    50 xp
    Positional and labeled indexing
    100 xp
    Indexing and column rearrangement
    100 xp
    Slicing DataFrames
    50 xp
    Slicing rows
    100 xp
    Slicing columns
    100 xp
    Subselecting DataFrames with lists
    100 xp
    Filtering DataFrames
    50 xp
    Thresholding data
    100 xp
    Filtering columns using other columns
    100 xp
    Filtering using NaNs
    100 xp
    Transforming DataFrames
    50 xp
    Using apply() to transform a column
    100 xp
    Using .map() with a dictionary
    100 xp
    Using vectorized functions
    100 xp
  2. 2

    Advanced indexing

    Having learned the fundamentals of working with DataFrames, you will now move on to more advanced indexing techniques. You will learn about MultiIndexes, or hierarchical indexes, and learn how to interact with and extract data from them.

    Play Chapter Now


Olympic medalsGapminder2012 US election results (Pennsylvania)Pittsburgh weather dataSalesTitanicUsers
Team Anaconda Headshot

Team Anaconda

Data Science Training

This course was created in collaboration with Anaconda. With over 6 million users, the open source Anaconda Distribution is the fastest and easiest way to do Python data science and machine learning. It's the industry standard for developing, testing, and training on a single machine.
See More

What do other learners have to say?

I've used other sites—Coursera, Udacity, things like that—but DataCamp's been the one that I've stuck with.

Devon Edwards Joseph
Lloyds Banking Group

DataCamp is the top resource I recommend for learning data science.

Louis Maiden
Harvard Business School

DataCamp is by far my favorite website to learn from.

Ronald Bowers
Decision Science Analytics, USAA