Chapter 3: Pandas Series

What is a Pandas Series, really?

A Series is:

  • A one-dimensional labeled array
  • It has data values + an index (labels for each value)
  • You can think of it as one column from a spreadsheet — but with superpowers

It is very similar to:

  • A Python list or NumPy array … but with labels
  • A single column in Excel or Google Sheets
  • A dictionary where keys are ordered and can be any type (not just strings)

1. Creating a Series – the most common ways

Python

Way 1 – From a Python list (most beginner-friendly)

Python

Output:

text

→ By default, pandas gives it a numeric index starting from 0.

Way 2 – With meaningful index (this is very common)

Python

Output:

text

→ Now we can use day names to access values — much more readable!

Way 3 – From a Python dictionary (very natural)

Python

Output:

text

→ Dictionary keys become the index, values become the data — very clean.

Way 4 – From scalar value (broadcasting — rare but useful)

Python
text

2. How to access values in a Series (very important)

There are two main ways — and you must know both.

Goal Syntax When to use
Access by position (0,1,2…) s.iloc[2] When order matters
Access by label (index) s[‘Tuesday’] or s.loc[‘Tuesday’] When labels are meaningful
Python

3. Important properties & methods you use all the time

Python

4. Filtering & conditions (this is where Series starts to shine)

Python

5. Creating new Series from calculations

Python

6. Very common real-life Series examples

Example 1 – Daily sales

Python

Example 2 – Employee ratings

Python

Summary – Series in one table (keep this close)

Concept Example code What you get
Create from list pd.Series([1,2,3,4]) Series with 0,1,2,3 index
Create with index pd.Series([10,20], index=[‘A’,’B’]) Labeled Series
Access by label s[‘Mon’] or s.loc[‘Mon’] Single value
Access by position s.iloc[0] Single value
Filter s[s > 50] New filtered Series
Basic stats s.mean(), s.median(), s.describe() Numbers
Boolean condition s >= 80 Series of True/False
Name the Series s.name = ‘scores’ Helps when it becomes a column

Now — what would you like to do next with Series?

  • Practice indexing & slicing in more detail
  • See how Series lives inside DataFrames (very important next step)
  • Do more filtering & conditions examples
  • Work with missing values (NaN) in Series
  • Try time series with dates as index
  • Convert Series → DataFrame and back

Just tell me which direction feels most useful or interesting right now. I’ll continue explaining slowly with real examples. 😊

You may also like...

Leave a Reply

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