Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
guipsamora
GitHub Repository: guipsamora/pandas_exercises
Path: blob/master/03_Grouping/Alcohol_Consumption/Exercise.ipynb
613 views
Kernel: Python 2

Ex - GroupBy

Introduction:

GroupBy can be summarized as Split-Apply-Combine.

Special thanks to: https://github.com/justmarkham for sharing the dataset and materials.

Check out this Diagram

Step 1. Import the necessary libraries

Step 2. Import the dataset from this address.

Step 3. Assign it to a variable called drinks.

Step 4. Which continent drinks more beer on average?

Step 5. For each continent print the statistics for wine consumption.

Step 6. Print the mean alcohol consumption per continent for every column

Step 7. Print the median alcohol consumption per continent for every column

Step 8. Print the mean, min and max values for spirit consumption.

This time output a DataFrame