Introduction to Pandas
Pandas is an open-source Python library for working with tabular data — the rows and columns you see in a spreadsheet — giving you fast, expressive tools to load, clean, analyse, and save real-world datasets.
Learn Introduction to Pandas in our free Pandas course — a beginner-friendly interactive lesson with worked examples, a practice exercise and a quick reference.
Part of the free Pandas course at LearnCodingFast — hands-on lessons with examples you run in your browser, plus practice exercises and a quick quiz.
In this first lesson you'll learn what Pandas is, why analysts everywhere rely on it, how to install and import it, and you'll build your very first table of data.
Pandas is a Python library for working with tabular data — data organised in rows and columns, exactly like a spreadsheet or a database table.
Pandas is built directly on top of NumPy , Python's fast numerical computing library. That means your data is stored in efficient C-backed arrays under the hood, so operations on millions of rows stay quick.
Plain Python lists and dictionaries struggle with real datasets. Pandas was designed to make data work effortless:
Install Pandas once from your terminal or command prompt using pip , Python's package installer:
This also installs NumPy automatically, because Pandas depends on it. If you use Anaconda, Pandas is already included.
Inside your Python file or notebook, import it with the universal alias pd :
The fastest way to create a table is from a dictionary . Each key becomes a column name , and each list of values becomes that column's data.
Pandas automatically adds a numbered index (0, 1, 2, ...) down the left side to label each row.
Build a small DataFrame describing three of your favourite movies:
Lesson 1 complete — welcome to Pandas!
You now know what Pandas is, why it's built on NumPy, how to install and import it, and you've created your first DataFrame from a dictionary.
🚀 Up next: The Series — meet Pandas' one-dimensional building block, the single labelled column every DataFrame is made of.
Practice quiz
What is Pandas primarily used for?
- 3D game rendering
- Working with tabular data in rows and columns
- Sending HTTP requests
- Compiling C code
Answer: Working with tabular data in rows and columns. Pandas is a Python library for tabular data, like a spreadsheet of rows and columns.
Which library is Pandas built on top of for fast numerical computing?
- NumPy
- Matplotlib
- Django
- TensorFlow
Answer: NumPy. Pandas stores data in efficient C-backed NumPy arrays under the hood.
What is the standard import statement for Pandas?
- import pd as pandas
- from pandas import *
- import pandas as pd
- require('pandas')
Answer: import pandas as pd. The universal convention is import pandas as pd.
Which command installs Pandas?
- npm install pandas
- pip install pandas
- apt get pandas
- pandas --setup
Answer: pip install pandas. pip install pandas installs it (and NumPy automatically).
Which Pandas object is a single labelled column (1-dimensional)?
- A Panel
- A DataFrame
- A Matrix
- A Series
Answer: A Series. A Series is the 1-D building block; a DataFrame is the 2-D table.
When you build a DataFrame from a dictionary, what does each key become?
- A column name
- A row label
- A data type
- An index number
Answer: A column name. Each dictionary key becomes a column name and its list becomes the column's values.
When you build a DataFrame from a dictionary, what index does Pandas add by default?
- The first column's values
- Random unique IDs
- A numbered index 0, 1, 2, ...
- No index at all
Answer: A numbered index 0, 1, 2, .... Pandas adds an automatic RangeIndex (0, 1, 2, ...) down the left side.
How do you check the installed Pandas version?
- pd.show_version
- pd.__version__
- pandas.check()
- pd.info
Answer: pd.__version__. pd.__version__ prints the installed version string.
Where does the name 'Pandas' come from?
- The animal
- Python Data Analysis
- Panel data
- Parallel data
Answer: Panel data. It comes from 'panel data', an econometrics term for multi-dimensional datasets.
What is the shape of pd.DataFrame({'name': ['A','B','C'], 'age': [1,2,3]})?
- (2, 3)
- (6, 1)
- (1, 6)
- (3, 2)
Answer: (3, 2). Three rows and two columns gives a shape of (3, 2).