Recap: Survey Results
Part of the Data and Plots section of Coddy's Machine Learning journey. Lesson 46 of 60.
Challenge
MediumA streaming app asked its users for a rating from 1 to 10. Some skipped it, so survey.csv has empty score cells:
Build the team a clean report:
- Print
Missing scores:and how many there are. - Drop the rows with a gap, then print
Answers kept:and how many rows are left. - From the kept rows, print the answers per device, most common first.
- Print a table of each age group's
meanandmaxscore.
For another survey, the report reads:
Missing scores: 2
Answers kept: 18
device
laptop 10
phone 5
tablet 3
Name: count, dtype: int64
mean max
age_group
18-29 7.5 10.0
30-44 6.4 9.0
45+ 5.0 8.0Try it yourself
import pandas as pd
survey = pd.read_csv("survey.csv")
# Write your code below
All lessons in Data and Plots
2NumPy Arrays
Creating ArraysShape and SizeRanges of NumbersIndexing and SlicingRecap: Temperature Grid3Array Math
Math on Whole ArraysSummary StatisticsStatistics by AxisBroadcastingBoolean MasksRecap: Exam Scores9Grouping and Cleaning
Counting ValuesGrouping DataSeveral SummariesMissing ValuesRecap: Survey ResultsPractice on your own: Online Python compiler