LoslegenKostenlos loslegen

Measures of central tendency

You've studied the frequency distribution of respondents, as well as the range and standard deviation of meals eaten out or ordered; you decide to analyze the dataset further. Remember, 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 calculate the central tendency of the survey data.

pandas as been loaded for you as pd.

Diese Übung ist Teil des Kurses

Analyzing Survey Data in Python

Kurs anzeigen

Anleitung zur Übung

  • Calculate the mean, median, and mode times per week that respondents ordered in or ate out.

Interaktive Übung

Vervollständige den Beispielcode, um diese Übung erfolgreich abzuschließen.

# Calculate the mean
mean_value = ____
print('mean_value = ', mean_value)

# Calculate the median
median_value = ____
print('median_value = ', median_value)

# Calculate the mode
mode_value = ____
print('mode_value = ', mode_value)
Code bearbeiten und ausführen