Reshaping Data with pandas

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: reshaping-data-pandas Category: Tags: , Brand:

Learn to pivot, melt, stack and unstack pandas DataFrames, work with multi-level indexes, and flatten list-like columns and nested JSON data.

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

Data arranged for people to read is often in the wrong shape for analysis. Reshaping DataFrames in pandas closes that gap. You convert tables between wide and long layouts, move index levels between rows and columns, split or join string columns, and flatten list-like and nested JSON data, practicing on FIFA player ratings, book reviews and other real datasets.

What You Will Achieve

  • Decide whether an analysis needs a wide or a long layout and convert a DataFrame in either direction
  • Split or concatenate string columns so their values are ready to analyze
  • Shift row index levels onto the column axis and back, then deal with the missing values the move creates
  • Expand list-like columns and read nested JSON files into a usable DataFrame


Program Overview

Wide and Long Data Formats

Sets out when each layout helps, then the pandas tools that turn a DataFrame long or wide and tidy its text fields.

  • Pivot method and pivot tables
  • Summary statistics on a large DataFrame
  • Melt and the wide to long function
  • Concatenating and splitting string columns

Stacking and Unstacking with Multi-Level Indexes

Uses multi-level indexing to rearrange levels between the row index and the column axis.

  • Stacking and unstacking rows and columns
  • Working with multiple index levels
  • Handling missing data after stacking or unstacking

Grouping and Nested Data

Combines reshaping with grouping for quick manipulations, then turns list-like and nested values into regular columns.

  • Reshaping combined with grouping
  • Transforming list-like columns
  • Reading nested JSON data into a DataFrame
  • Un-nesting nested data columns

Certificate Awarded (Paid)


Job Outlook

Reshaping tables is routine work for data analysts and data scientists using Python, wherever exported tables or nested JSON files must be put into a workable shape before analysis begins.


Our take

Good for: Analysts working in pandas who regularly face tables or nested JSON files that need rearranging before any analysis can start.

Keep in mind: Each chapter practices on its own datasets, such as FIFA ratings, book reviews and call records, so you carry each method over to your own files yourself.

Bottom line: A focused run of exercises on pandas reshaping methods that carries through to the awkward cases of multi-level indexes and nested JSON.

Frequently Asked Questions

What separates wide data from long data?

In a wide table each observation sits on one row and its variables spread across many columns. A long table moves those variables into rows instead. The lessons set out the advantages of each layout and practice converting a DataFrame both ways.

Which pandas methods do the lessons use for reshaping?

The early chapters work with pivot, pivot tables, melt and the wide_to_long function. Later chapters use stacking and unstacking on multi-level indexes, combine reshaping with grouping, and transform list-like columns and nested data so each value ends up in its own column.

What kind of data do the exercises work with?

The practice data includes FIFA player ratings, book reviews and churn analysis data. Later chapters also work with call records and nested data on movies and birds, so each reshaping method is tried on a different real-world table.

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
    Reshaping Data with pandas
    Reshaping Data with pandas
    LiveTalent
    Logo
    Compare items
    • Total (0)
    Compare
    0