Locked lesson.
About this lesson
Pandas series is one of the main "workhorses" of Pandas. We'll discuss how series work and some of the helpful ways you can use them.
Exercise files
Download this lesson’s related exercise files.
Pandas Series.docx57.1 KB Pandas Series - Solution.docx
56.7 KB
Quick reference
Pandas Series
Series are similar to Numpy Arrays, but they have an index.
When to use
Throughout the course we'll be mostly working with Pandas DataFrames, but DataFrames are made up of Series so it's important to understand them.
Instructions
A series contains data and labels. To create a Series:
label = ["Mon", "Tues", "Wed"]
data = [12, 41, 36]
my_series = pd.Series(data, label)
To pull specific data from a series...for Instance, Monday:
my_series["Mon"]
To create a series from a Python Dictionary:
dict = {"Mon": 12, "Tues":41, "Wed":36}
my_series = pd.Series(dict)
Hints & tips
- Series and DataFrames are the two main workhorses of Pandas
- DataFrames are made of Series
Lesson notes are only available for subscribers.