0Pricing
Data Science Academy · Lesson

A Column With a Name and Index

What makes a Series different from a list.

A Column With a Name and Index is a free Data Science Academy lesson on CoddyKit — lesson 1 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the Data Science Academy learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.

Meet the Series

A Series is pandas' one-dimensional column: a sequence of values that all share one name and one type. Think of it as a single spreadsheet column. 📊

More Than a List

A plain Python list just holds values in order. A Series pairs every value with a label, so each item has both a position and a name you can look up by.

Create One Quickly

Pass any list to pd.Series and pandas wraps it for you. This line below builds your very first Series from three numbers.

import pandas as pd
s = pd.Series([10, 20, 30])
print(s)

The Hidden Index

Notice the numbers on the left of your output. That is the index: a label for every value. Without one supplied, pandas auto-numbers from 0.

Give It Real Labels

You can set meaningful labels with the index argument. Now each value is named, which makes lookups read like plain English. 🏷️

s = pd.Series([90, 75, 88], index=['Ada', 'Bo', 'Cy'])
print(s['Bo'])

One Type Inside

Every Series carries a single dtype, like int64 or float64. Shared types are what let pandas run fast math across the whole column at once.

print(s.dtype)

Name the Whole Series

A Series can also carry its own name, separate from the index. That name becomes the column header once the Series joins a DataFrame.

s.name = 'score'
print(s.name)

Values and Index Apart

You can pull the two parts out on their own. The .values attribute gives the raw data array; .index gives the labels that tag it.

print(s.values)
print(s.index)

Build From a Dict

Hand pd.Series a dictionary and the keys become the index automatically. It is the fastest way to build a labeled column in one step.

ages = pd.Series({'Ada': 36, 'Bo': 41})
print(ages)

Length and Peek

len(s) tells you how many values sit inside, and .head() shows just the first few. Both are handy first checks on any Series.

print(len(s))
print(s.head(2))

The Column Building Block

Stack several Series side by side and you get a DataFrame. So mastering the Series means you already understand half of pandas. 🧱

Quick Check

Let's lock in what a Series carries.

Recap

You learned a Series is a named, single-typed column where every value has an index label. It is the basic block that DataFrames are built from. Nice work! 🎉

Frequently asked questions

Is the “A Column With a Name and Index” lesson free?

Yes — the full text of “A Column With a Name and Index” is free to read here on the web, and the Data Science Academy course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the Data Science Academy course, upgrade to CoddyKit PRO.

What will I learn in “A Column With a Name and Index”?

What makes a Series different from a list. You practise Data Science Academy with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.

Do I need any experience to start Data Science Academy?

No prior experience is required. Data Science Academy on CoddyKit is structured for beginners through advanced learners; this is — lesson 1 of 4, so you can start here or from the beginning and move at your own pace.

How long does the “A Column With a Name and Index” lesson take?

Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.

Can I write and run code in this Data Science Academy lesson?

Yes. Every Data Science Academy lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.

All lessons in this course

  1. A Column With a Name and Index
  2. Label-Based vs Position-Based Access
  3. Series Math and Alignment
  4. Counting and Spotting Values
← Back to Data Science Academy