Pandas Introduction

Series, DataFrames and why analysts love pandas.

✍️ 3 exercises + code challenge in this lesson

Pandas makes it easy to load, clean, explore and analyse tabular data, like a spreadsheet in Python.

  • Series: a single labelled column of data.
  • DataFrame: a table of rows and columns.

Import it as import pandas as pd. Install locally with pip install pandas.

The first run loads pandas in your browser, which can take several seconds.

Key Takeaways: Pandas Introduction

Mastering Pandas Introduction helps you write clean and reliable Pandas code. Follow standard conventions, test edge cases, and keep logic simple. Try running the code example below and complete the exercises to build confidence.

Pandas Introduction Code Example

Pandas
import pandas as pd

df = pd.DataFrame({
    "name": ["Ali", "Sara", "Usman"],
    "city": ["Lahore", "Karachi", "Islamabad"],
    "marks": [81, 94, 67],
})
print(df)
Output
name       city  marks
0    Ali     Lahore     81
1   Sara    Karachi     94
2  Usman  Islamabad     67
Free sign-in required · Google login available

Pandas Introduction Practice Exercises

Check what you learned in “Pandas Introduction”.

/ 3 solved
Fill in the blank

Import pandas with its standard alias.

import pandas  pd
✓ Correct! Not quite. Try again.
Multiple choice

What is a DataFrame?

✓ Correct! Not quite. Try again.
Code challenge

Print the number of rows in df using len().

Write the code in the live editor. Your answer is checked automatically.

Free sign-in required · Google login available

to save your exercise progress.
Finished this lesson?
Mark it complete to track your progress.

Stuck on something?

Ask the community in the CodesInTech forum.

Need a developer?

Learning on your own is great — and when you need professional help, our team builds custom software, websites and mobile apps for clients worldwide.

Explore Our Services