

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Difficulty: 7
click for more info
Not enough gems
Cost: 6 gems
1: What Is Pandas?
incomplete
2: Series
incomplete
3: DataFrames
incomplete
4: Derived Columns
incomplete
5: Series vs. DataFrame
incomplete
6: Filtering Data
incomplete
7: The Index in Pandas
incomplete
8: Custom Indexes
incomplete
9: Loading Data
incomplete
10: Inspect Head
incomplete
11: Info & Describe
incomplete
12: Inspecting Workflow
incomplete
13: Data Properties
incomplete
14: Inspecting Columns
incomplete
Back
ctrl+,
Next
ctrl+.
This lesson's interactive features are locked, please to keep using them
While a Series represents a single column of data, a DataFrame is basically a table that can contain an arbitrary number of Series (columns).
It's essentially Pandas' version of an Excel spreadsheet, CSV file, or SQL table.
Say we have a collection of a few columns that represent player data from an RPG:
data = {
"player": ["Geralt", "Ciri", "Triss"],
"gold_earned": [150, 300, 75],
"online": [True, False, True],
}
df = pd.DataFrame(data)
print(df)
Prints:
player gold_earned online
0 Geralt 150 True
1 Ciri 300 False
2 Triss 75 True
0, 1, 2player, gold_earned, onlineDataFrames are everywhere in data manipulation; we'll be using these a lot.
We'll often use the variable name df as a concise way of representing a DataFrame in examples.
Complete the create_device_dataframe function. It accepts a dictionary with three lists and returns a Pandas DataFrame with an added human-readable status column.
Try printing the data before and after putting it in the DataFrame to see the difference in formatting!