LambdaLab
Informatics Practices · Class 12 · Python Pandas
PandasFoundations⏱️ 6 min read

Introduction to Pandas

Ever wondered how to efficiently manage and analyse data in Python? Meet Pandas — your go-to library for powerful, intuitive data handling. If NumPy gave us fast numbers, Pandas gives us labelled, spreadsheet-like data.

1What is Pandas?

  • 🐼 It's Python's go-to library for data analysis.
  • ⚡ It offers high performance and intuitive data structures.
  • 📦 The name "Pandas" comes from "Panel Data" — a term for multi-dimensional datasets.
  • 👨‍💻 It was created by the brilliant Wes McKinney in 2008.

2Installing & importing Pandas

Pandas isn't built into Python, so first you install it once with pip (Python's package installer). Open a terminal or command prompt and run:

terminal
pip install pandas

Then, in every program, you import it. The whole world imports it under the short alias pd:

example.py
import pandas as pd

3The three data structures

Pandas organises your data into specialised data structures. There are three in the family — but only the first two matter for you:

The 3 data structures

Tap a structure to see how its shape changes.

Student Height
0160
1175
2155
3180
1 column · 1-Dimensional
Series

A single labelled column — like one column of a spreadsheet, or a Python list with superpowers. This whole chapter is about the Series.

Note
Series (1-D) and DataFrame (2-D) are your bread and butter. Panel (3-D) is not part of your syllabus — in fact it was removed from modern Pandas entirely — so we mention it only for completeness.

4Series vs DataFrame: the quick gist

Both hold data, but they differ in shape and in the rules they follow:

Series vs DataFrame
PropertySeries (1-D)DataFrame (2-D)
Dimensions1-dimensional2-dimensional
Type of dataHomogeneous (all one type)Heterogeneous (columns can differ)
MutabilityValues mutable · size immutableValues mutable · size mutable
Series = a single list
Think of it like a single labelled column — our "Student Height Series". Perfect for one set of data with labels.
DataFrame = a full spreadsheet
Imagine a whole table with rows and columns — our "Student Grade DataFrame". Ideal for tabular data.

Simply put: a Series is for single lists, and a DataFrame is for tables. This chapter now zooms right into the Series — the building block that everything else is made of.

Quick Check

Where does the name 'Pandas' come from?

Quick Check

Which data structure is 1-dimensional and holds all one type of data?