Chapter 2: Pandas Getting Started

Pandas – Getting Started (realistic first day)

Step 0 – What should you expect today?

Today we want to reach this point:

  • Know how to install & import pandas
  • Understand what a DataFrame and Series are
  • Create your first table
  • Look at the data in the most useful ways
  • Select columns and rows
  • Make very simple new columns
  • Feel comfortable running 10–15 most common beginner commands

That’s already enough to start playing with real small datasets.

Step 1 – Make sure pandas is available

In Jupyter Notebook / JupyterLab / VS Code / Google Colab

Python

In your own computer (terminal / command prompt / powershell)

Bash

Then in Python:

Python

Almost everyone uses the short name pd — just follow this convention.

Step 2 – Our very first DataFrame (the most common way to start)

Python

You will see something like this:

text

This is a pandas DataFrame — your main working object.

Step 3 – The 8 most important things to check first (do this every time!)

Python
Python

Tip: students.info() and students.head() are the two commands you will run most often in your entire pandas life.

Step 4 – Selecting data – the four most common patterns

Python

Very common combination:

Python

Step 5 – Creating new columns (first magic moment)

Python

Now your table has more columns — this is how you grow your data step by step.

Step 6 – Sorting (very satisfying)

Python

Step 7 – Tiny first summary with groupby

Python

Even this simple groupby already gives you real insight.

Your Day-1 Cheat Sheet – Commands you should be able to write from memory

Python

Small practice task you can do right now (5–10 minutes)

  1. Copy the students table code
  2. Add 2–3 more students (add your friends or family names)
  3. Add a new column called attendance (values between 65–100)
  4. Create a column final_score = (marks + attendance) / 2
  5. Show only students with final_score ≥ 80
  6. Sort them by final_score descending

Try it — then come back and tell me what you got, or ask what went wrong.

Where do you want to go next?

  • Learn how to read CSV files (most common next step)
  • Practice more filtering with many conditions
  • Understand Series vs DataFrame more clearly
  • Start playing with missing values (NaN)
  • Try your first real small dataset together
  • Go one step deeper into groupby

Just tell me which direction feels right for you right now. I’ll keep explaining slowly and with examples. 😊

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *