Aan de slagGa gratis aan de slag

Frequency distribution

Studying dietary habits across various demographics will help understand a plethora of things about individuals and groups, their health and lifestyle, among other things. As a result, the survey, dietary_habits asked participants their age group, Age, gender, Gender, how many meals they had in a day, meals_per_day, and how many times a week they ordered in or ate out, eat_out_per_wk.

In this exercise, you will create a frequency distribution of the number of responses for each age group in the survey data.

pandas as been loaded for you as pd, and matplotlib.pyplot as plt.

Deze oefening maakt deel uit van de cursus

Analyzing Survey Data in Python

Cursus bekijken

Praktische interactieve oefening

Probeer deze oefening eens door deze voorbeeldcode in te vullen.

# Count the number of responses for each age group
freq_dist = ____.____.____().____('Number')
print(freq_dist)
Code bewerken en uitvoeren