Pandas Getting Started

Pandas Getting Started

What is a Series?

A Pandas Series is like a column in a table.

It is a one-dimensional array holding data of any type.


Create a simple Pandas Series from a list:

Try it Yourself »


If nothing else is specified, the values are labeled with their index number. First value has index 0, second value has index 1 etc.

This label can be used to access a specified value.


Return the first value of the Series:

Try it Yourself »

Create Labels

With the index argument, you can name your own labels.


Create you own labels:

Try it Yourself »

When you have created labels, you can access an item by referring to the label.


Return the value of “y”:

Try it Yourself »


Get Certified!

Complete the Pandas modules, do the exercises, take the exam, and you will become w3schools certified!


Key/Value Objects as Series

You can also use a key/value object, like a dictionary, when creating a Series.


Create a simple Pandas Series from a dictionary:

Try it Yourself »

Note: The keys of the dictionary become the labels.

To select only some of the items in the dictionary, use the index argument and specify only the items you want to include in the Series.


Create a Series using only data from “day1” and “day2”:

Try it Yourself »


Data sets in Pandas are usually multi-dimensional tables, called DataFrames.

Series is like a column, a DataFrame is the whole table.


Create a DataFrame from two Series:

Try it Yourself »

You will learn about DataFrames in the next chapter.

Test Yourself With Exercises


Insert the correct Pandas method to create a Series.

Start the Exercise