Menu
CoddyTech

Recap: Survey Results

Part of the Data and Plots section of Coddy's Machine Learning journey. Lesson 46 of 60.

challenge icon

Challenge

Medium

A streaming app asked its users for a rating from 1 to 10. Some skipped it, so survey.csv has empty score cells:

The first seven rows of survey.csv as a table of age_group, device and score; row 6 has no score, marked NaN

Build the team a clean report:

  1. Print Missing scores: and how many there are.
  2. Drop the rows with a gap, then print Answers kept: and how many rows are left.
  3. From the kept rows, print the answers per device, most common first.
  4. Print a table of each age group's mean and max score.

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.0

Try it yourself

import pandas as pd

survey = pd.read_csv("survey.csv")

# Write your code below

All lessons in Data and Plots

Practice on your own: Online Python compiler