Chocolate location vs. rating
Are chocolates from certain countries better than those from others? And what about different companies? You can use grouped summary statistics to find out!
The chocolates
dataset and the DataFrames
and Statistics
packages have been loaded for you.
This exercise is part of the course
Data Manipulation in Julia
Exercise instructions
- Group the
chocolates
DataFrame bycompany_location
andcompany
, saving the result aschoc_groups
. - Compute the
minimum
,median
, andmaximum
ofrating
for each group, renaming the columns asmin_rating
,med_rating
, andmax_rating
; save the result aschoc_groups_stats
. - Sort
choc_groups_stats
by themed_rating
column in reverse order.
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
# Create choc_groups
____
# Calculate minimum, median, maximum of rating, rename the new columns and save the result
____
# Sort choc_groups_stats by med_rating in reverse
____