

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Difficulty: 4
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
Once you understand your DataFrame as a whole, you can inspect individual Series (columns) with a few more tools:
.unique() method returns an array of the unique values in a Series..value_counts() method returns a Series containing counts of unique values.df = pd.read_csv("games.csv")
print(df["genre"].unique())
# ['RPG' 'Shooter' 'Puzzle']
print(df["genre"].value_counts())
# RPG 150
# Shooter 120
# Puzzle 80
In the example above, there are:
"genre" column"genre" is "RPG", 120 rows where it's "Shooter", etc.The .value_counts() method lists results in descending order by default.
SnackStack's support team needs to understand what types of devices are in their dataset and how many of each type exist.
Complete the analyze_device_types function. It accepts a DataFrame and returns a tuple of the unique device types and a count of each type.