Python Central HubSign in

Data Analytics with Python / Phase 3: Data Manipulation with Pandas

Introduction to Pandas

Learn what Pandas is, why it’s essential for data analytics, and how it fits into the Python data stack.

What is Pandas?

Pandas is a Python library for working with structured data.

It gives you two core data structures:

  • Series: a 1‑dimensional labeled array (like a single column)
  • DataFrame: a 2‑dimensional labeled table (like a spreadsheet / SQL table)

Pandas is built on top of NumPy, so many NumPy concepts (like arrays, vectorization, and missing values) show up again here. As Wes McKinney (the creator of Pandas) puts it, NumPy is best for homogeneous numeric arrays, while Pandas is built specifically for tabular, heterogeneous data — the messy, real-world tables you get from spreadsheets, databases, and APIs.

In real data work, you spend a lot of time:

  • Reading data from CSV/Excel/JSON/APIs
  • Cleaning messy values
  • Handling missing data
  • Filtering and transforming rows/columns
  • Aggregating data into summaries
  • Preparing datasets for visualization and machine learning

Pandas is designed for exactly this.

When (not) to use Pandas

Pandas is great for:

  • Small-to-medium datasets that fit in memory
  • Exploratory analysis
  • Data cleaning and feature engineering

Pandas may not be ideal for:

  • Huge datasets that don’t fit in memory (use DuckDB/Polars/Spark)
  • Highly-parallel compute workloads

Installing Pandas

If you already installed libraries in Phase 1, you probably have it.

Install with pip

Shell
pip install pandas

Install with conda

Shell
conda install pandas

Your first Pandas import

Python
import pandas as pd
 
print(pd.__version__)

Quick mental model: DataFrame thinking

A DataFrame is basically:

  • Rows (observations / records)
  • Columns (features / fields)

Common questions you’ll ask:

  • What columns do I have?
  • How many rows?
  • Are there missing values?
  • How do I filter rows?
  • How do I compute group summaries?

We’ll answer all of these in this phase.

Visualize it

diagram From raw data to insight mermaid
Pandas sits between messy raw sources and the analysis you actually want to do.

🧪 Try It Yourself

Exercise 1 – Import Pandas and Check the Version

exerciseYour turn

Tab indents. Press Escape, then Tab, to leave the editor. Control plus Enter runs the code; Control plus Shift plus Enter submits it.

Output
Press Run to see what your code prints.

Exercise 2 – Create Your First Series

exerciseYour turn

Tab indents. Press Escape, then Tab, to leave the editor. Control plus Enter runs the code; Control plus Shift plus Enter submits it.

Output
Press Run to see what your code prints.

Exercise 3 – Build a DataFrame From a Dict

exerciseYour turn

Tab indents. Press Escape, then Tab, to leave the editor. Control plus Enter runs the code; Control plus Shift plus Enter submits it.

Output
Press Run to see what your code prints.

Check your understanding

quizCheck yourself
  1. What are the two core pandas data structures?

    Show answer

    A — Series and DataFrame — A Series is a 1-dimensional labeled array like a single column, and a DataFrame is a 2-dimensional labeled table.

  2. On what library is pandas built?

    Show answer

    A — NumPy — Pandas is built on top of NumPy, so arrays, vectorization and missing values carry over.

  3. For which situation does the lesson suggest looking beyond pandas?

    Show answer

    A — Huge datasets that do not fit in memory — Pandas suits small-to-medium data that fits in memory. For larger data the lesson mentions DuckDB, Polars or Spark.

  4. What do you run to check which pandas version is installed?

    Show answer

    A — print(pd.__version__) after import pandas as pd — The lesson imports pandas as pd and prints pd.__version__.

Next

Now that you know what Pandas is and why it matters, move on to Series and DataFrames to build and inspect these structures in more depth.

Was this page helpful?

Let us know how we did