beginner · python

Pandas Data Wrangling

Learn to inspect, clean, transform, combine, summarize, and communicate insights from messy tabular data with Python and Pandas. A single real-world dataset, NYC 311 service requests, is threaded throughout the curriculum so learners practice judgment and reliable workflows alongside syntax.

What you could build

  • Analyze seasonal and geographic patterns in public service requests.
  • Create a data-quality report that identifies missing, duplicated, and inconsistent records.
  • Compare request categories across neighborhoods using grouped summaries and reshaped tables.
  • Build a repeatable workflow that combines service requests with geographic reference data.
  • Prepare a concise analytical report from a cleaned public dataset.

You pick the project at the start — these are examples, not a fixed list.

What you'll be able to do

  • Load a delimited data file, inspect its dimensions and columns, interpret its dtypes, and parse date fields for reliable analysis.
  • Select, filter, summarize, and inspect records using labels, positions, Boolean conditions, unique values, frequencies, and descriptive statistics.
  • Diagnose and clean missing, duplicated, inconsistent, nonnumeric, and implausible values while explaining the effect of each decision.
  • Combine tables with concatenation and merges by choosing appropriate axes, keys, join types, cardinalities, indexes, and column-conflict handling.
  • Define measurable questions, calculate defensible rates and comparisons, interpret trends and outliers, and communicate evidence with appropriate limitations.

Who this is for

This course is for learners who know basic Python and want a structured way to work with messy tabular data in Pandas. It fits anyone who wants to move beyond isolated commands and reason carefully about cleaning choices, table structure, summaries, and evidence.

What you should already know

  • Basic Python syntax, including variables, functions, lists, dictionaries, and importing modules.
  • Ability to run Python code in a notebook or comparable development environment.
  • Basic familiarity with rows, columns, and common numeric summaries such as counts, averages, and percentages.

How a lesson actually goes

Lesson 1
TutorWelcome to Pandas Data Wrangling. After a brief overview of the course, we will begin with the Pandas Series: a one-dimensional labeled structure. Think of it as values paired with an index, rather than values existing only at unnamed positions.
YouSo a Series is basically a Python list, except Pandas adds labels to the items?
TutorThat is a useful starting point, but there is an important difference. A list mainly gives you positional access, while a Series stores both its values and its index, and that index can be used to align data. Let’s separate those two ideas before we continue.
YouThe values are the data itself, and the index is the row number? I’m not sure whether the index always has to be numbers.
TutorThe values are correct. The index often starts as integer labels, but it can also contain strings, dates, or other labels; it is not required to be a simple row counter. If we label three request counts by borough names, those names can serve as the index.
YouThen two Series could line up by borough name even if their rows were originally in different orders. I see why the index is more than numbering.

Written from this course's first lesson to show the format — not a recording of a real session.

Course content

marks each module's capstone lesson.

01Foundations and Loading9 lessons

Establish the foundational mental models for Pandas objects and indexes, then learn to load tabular data and verify its structure, types, and dates reliably.

  • Course Introduction

    Welcome and orientation: overview of the learning path, key outcomes, and how modules build on each other.

  • Series

    A Series is a one-dimensional Pandas object whose values are associated with labels. Learners distinguish the data from its index and recognize how labels support reliable access.

  • DataFrames

    A DataFrame combines aligned Series into a rectangular table with row and column labels. Learners relate columns, rows, and cells to the underlying tabular model.

  • Indexes

    The index identifies rows and enables label-based alignment during Pandas operations. Learners distinguish an index from ordinary data columns and understand why its values need not be unique in every dataset.

  • Reading CSV Files

    CSV loading maps rows and delimited fields into a DataFrame, while options such as separators, headers, and missing-value markers affect interpretation. Learners identify how loading choices can change the resulting table.

  • DataFrame Inspection

    Inspection provides an evidence-based first view of loaded data before transformation. Learners use shape, head or tail, and column information to detect unexpected structure.

  • Data Types

    Pandas assigns dtypes that describe how column values are stored and interpreted. Learners recognize common numeric, text, boolean, and object-like types and connect them to valid operations.

  • Date Parsing

    Date parsing transforms strings into values Pandas can compare, sort, and use for time-based analysis. Learners recognize the difference between text that resembles a date and an actual datetime representation.

  • Foundations and Loading Review

    This capstone assessment combines the module's foundational concepts in a sequence of reasoning tasks. Learners diagnose structural and typing issues and justify the checks needed to establish a trustworthy starting point.

02Selecting and Inspecting Data9 lessons

Learn to select columns and rows precisely, filter records with Boolean logic, and inspect values and distributions in targeted portions of a DataFrame.

  • Column Selection

    Column selection retrieves specific fields from a DataFrame using column labels. The number and form of selected labels affect whether the result is a Series or a DataFrame.

  • Label-Based Row Selection

    Label-based selection uses the DataFrame's explicit labels to retrieve particular rows, columns, or rectangular subsets. It is especially useful when the intended selection is expressed in terms of meaningful labels rather than physical positions.

  • Position-Based Row Selection

    Position-based selection retrieves data according to zero-based row and column locations. It remains useful when selections depend on order rather than index labels.

  • Boolean Filtering

    Boolean filtering uses a True-or-False value for each row to select matching records. Comparisons against Series values produce masks that can be passed back to the DataFrame.

  • Compound Boolean Conditions

    Compound conditions refine filtering by requiring several criteria simultaneously or allowing any of several criteria. Parentheses and Pandas-compatible elementwise operators are necessary for unambiguous evaluation.

  • Unique-Value Inspection

    Unique-value inspection reveals which categories or values occur in a column and how many distinct values it contains. These checks help identify unexpected labels, coding patterns, and potential data-quality issues.

  • Frequency Inspection

    Frequency inspection ranks or reports the occurrence count of each observed value. It provides a direct view of category balance, dominant values, and rare values.

  • Descriptive Summaries

    Descriptive summaries condense selected columns into statistics such as count, mean, spread, minimum, and quantiles, with summary behavior depending on data type. They provide a compact way to assess scale, variation, and possible anomalies.

  • Selection and Inspection Synthesis

    This synthesis integrates column and row selection, Boolean filtering, compound criteria, and inspection techniques. It assesses whether learners can choose a precise subset and interpret the resulting evidence without confusing labels, positions, value counts, or summary statistics.

03Cleaning Messy Data8 lessons

Learn to detect and correct common data-quality problems in Pandas, including missing values, duplicate rows, inconsistent text, invalid numeric values, and values outside expected ranges.

  • Missing-Value Detection

    Missing values can appear as recognized nulls, blank entries, or special sentinel values. Learners interpret null-count summaries and determine which parts of a table require attention.

  • Missing-Value Handling

    Pandas provides multiple ways to remove or fill null values. Learners compare deletion and replacement choices while reasoning about how each choice affects row counts, distributions, and interpretation.

  • Duplicate Rows

    Duplicate rows may represent repeated observations or legitimate repeated events. Learners inspect duplicate masks and reason about whether duplication should be evaluated across all columns or a selected subset.

  • Text Normalization

    Text values that differ only in spacing or capitalization can be treated as different categories. Learners use string transformations to make equivalent textual representations consistent.

  • Category Standardization

    Categorical columns often contain alternate spellings, abbreviations, or obsolete labels that represent the same meaning. Learners distinguish formatting normalization from semantic recoding and evaluate the completeness of a mapping.

  • Numeric Coercion

    Numbers stored as strings cannot be analyzed like numeric columns, and malformed entries can prevent direct conversion. Learners use coercion outcomes to separate valid numbers from values requiring review.

  • Range Validation

    A value can have a valid dtype yet still be impossible or suspicious for the field it represents. Learners create range checks and distinguish invalid values from legitimate extremes that should be investigated rather than automatically removed.

  • Cleaning Synthesis

    Reliable cleaning requires diagnosing problems before transforming data and checking the results afterward. Learners synthesize null handling, duplicate detection, text and category cleanup, numeric conversion, and range validation into a defensible sequence of decisions.

04Combining Tables8 lessons

Learn how to combine DataFrames vertically and horizontally, match records using keys or indexes, interpret unmatched rows, and validate whether a combination reflects the intended data relationship.

  • Concatenation

    Concatenation places DataFrames together by stacking rows or arranging columns. Learners interpret how labels, shapes, and missing values change when tables are combined.

  • Concatenation Axes

    The axis argument determines whether DataFrames are appended vertically or aligned side by side. Learners distinguish the effects of row-wise and column-wise concatenation.

  • Merge Keys

    A merge matches rows by comparing key columns rather than by row position. Learners determine whether a candidate key is appropriate and distinguish key values from ordinary attributes.

  • Join Types

    Join types control which rows survive when key values appear in one table, both tables, or neither matching pair. Learners predict the row coverage and missing values produced by each join type.

  • Merge Cardinality

    Merge cardinality describes how many rows can match for each key value on each side. Learners use uniqueness expectations to detect unintended row multiplication and validate relationship assumptions.

  • Index Joins

    Index-based joins align rows through index labels instead of explicitly named columns. Learners compare index joins with column-key merges and identify the alignment implied by each.

  • Column Conflicts

    When both input tables contain columns with the same non-key name, Pandas uses suffixes to distinguish their values. Learners identify the source and meaning of each resulting column.

  • Combining Tables Synthesis

    Learners synthesize table-combination decisions by determining whether to concatenate or match records, selecting the alignment structure and join behavior, and evaluating the resulting rows, columns, missing values, and key relationships.

05Reshaping and Summarizing8 lessons

Learn to group records, calculate meaningful summaries, and reshape DataFrames between long and wide forms while interpreting how each operation affects structure and meaning.

  • Grouping Keys

    Grouping partitions rows according to shared values in one or more grouping keys. The resulting grouped object represents subsets that can be inspected or summarized separately.

  • Aggregation Functions

    Aggregation reduces multiple values to a summary such as a count, sum, mean, minimum, maximum, or median. The choice of function determines what aspect of the data is represented.

  • Grouped Aggregation

    Grouped aggregation applies a reduction to each group rather than to the entire DataFrame. The resulting index and values show how the selected measure differs across groups.

  • Multiple Aggregations

    Multiple aggregations calculate several summaries at once, either for one column or across different columns. The output may contain hierarchical or explicitly named columns that distinguish the measures.

  • Pivot Tables

    A pivot table groups records by one set of row labels and optionally another set of column labels, then applies an aggregation to a value field. It creates a compact cross-tabular view of a measure.

  • Long-to-Wide Reshaping

    Long-to-wide reshaping spreads values from a variable column across new columns while retaining identifier fields. The operation changes the table's layout without changing the underlying observations when identifiers are sufficiently unique.

  • Wide-to-Long Reshaping

    Wide-to-long reshaping gathers multiple similarly structured columns into one variable column and one value column. This format often makes filtering, grouping, and comparison across measures more consistent.

  • Reshaping and Summarizing Synthesis

    Synthesize the module's techniques to reason from analytical questions to an appropriate grouping, summary, or table layout. Evaluate whether the resulting shape, index, labels, and aggregated values preserve the intended meaning.

06Analysis and Communication9 lessons

Learn to turn structured summaries into defensible analysis by defining measurable questions, selecting meaningful metrics, making contextual comparisons, interpreting trends, recognizing limitations, and communicating evidence-based insights clearly.

  • Analytical Questions

    A well-defined analytical question identifies the population, variables, comparison, and time frame needed for analysis. Learners distinguish answerable questions from vague or underspecified prompts.

  • Metric Definitions

    A metric is meaningful only when its calculation and unit are explicit. Learners distinguish counts, sums, averages, medians, and other summaries according to the question being answered.

  • Rates and Denominators

    Rates place counts in context by relating an event to an appropriate population, exposure, or time period. Learners recognize how an inappropriate denominator can distort comparisons.

  • Comparison Context

    Comparisons become informative when they use a relevant baseline, such as another group, period, target, or overall value. Learners distinguish absolute differences from relative differences and identify misleading comparison choices.

  • Trend Analysis

    Trend analysis examines how a measure changes across ordered time periods. Learners distinguish sustained movement from short-term fluctuation and avoid inferring a trend from isolated values.

  • Outlier Interpretation

    An outlier is an observation that differs substantially from the rest of the data, but unusual does not automatically mean incorrect. Learners use surrounding records, distributions, and domain-relevant checks to evaluate possible explanations.

  • Evidence Limitations

    Analytical results are bounded by how records were collected, defined, and retained. Learners recognize sources of bias, incomplete coverage, ambiguous measures, and the difference between association and causation.

  • Insight Statements

    An effective insight states what changed or differed, quantifies the evidence, and avoids claims that exceed what the data supports. Learners separate observation from interpretation and include relevant context or limitations.

  • Analysis and Communication Synthesis

    This synthesis evaluates the complete reasoning path from question to communication. Learners must align metrics and denominators with the question, interpret comparisons and trends responsibly, assess unusual values and limitations, and express conclusions that remain supported by the evidence.

Questions

Do I need to know Pandas already?

No. The course introduces Series, DataFrames, indexes, loading, inspection, and dtypes before moving into selection, cleaning, combining, reshaping, and analysis. You should be comfortable with basic Python.

Will this course teach more than Pandas syntax?

Yes. Alongside syntax, you will practice deciding how to handle missing and invalid data, selecting join strategies, choosing denominators, interpreting unusual values, and qualifying conclusions.

What dataset is used for practice?

A single real-world NYC 311 service-request dataset is threaded through the curriculum so the same workflow develops from loading and cleaning through summaries and communication.

Does the course cover statistics or machine learning?

It covers practical descriptive analysis: grouped summaries, rates, comparisons, trends, outliers, and evidence limitations. It does not focus on machine-learning models or advanced statistical inference.

How much attention is given to messy data?

A full module covers missing values, duplicates, text normalization, category standardization, numeric coercion, and range validation, with a synthesis lesson requiring you to evaluate the consequences of cleaning choices.

The first lesson is ten minutes away.

Free while codeset is early. You choose what you're building before the first lesson starts, and the course is taught around it.

Start this course

Other courses