mlcourse.ai – Open Machine Learning Course

Author: Arina Lopukhova (@erynn). Edited by Yury Kashnitskiy (@yorko). This material is subject to the terms and conditions of the Creative Commons CC BY-NC-SA 4.0 license. Free use is permitted for any non-commercial purpose.

Assignment #1. Fall 2018

Exploratory data analysis of Olympic games with Pandas

There are ten questions about 120 years of Olympic history: athletes and results dataset in this task. Your task is to fill in the missing Python code and choose answers in this web-form.

Download the file athlete_events.csv from Kaggle page. The dataset has the following features (copied from Kaggle):

  • ID - Unique number for each athlete
  • Name - Athlete's name
  • Sex - M or F
  • Age - Integer
  • Height - In centimeters
  • Weight - In kilograms
  • Team - Team name
  • NOC - National Olympic Committee 3-letter code
  • Games - Year and season
  • Year - Integer
  • Season - Summer or Winter
  • City - Host city
  • Sport - Sport
  • Event - Event
  • Medal - Gold, Silver, Bronze, or NA
In [1]:
import pandas as pd
In [2]:
# Change the path to the dataset file if needed. 
PATH = '../../data/athlete_events.csv'
In [3]:
data = pd.read_csv(PATH)
data.head()
Out[3]:
ID Name Sex Age Height Weight Team NOC Games Year Season City Sport Event Medal
0 1 A Dijiang M 24.0 180.0 80.0 China CHN 1992 Summer 1992 Summer Barcelona Basketball Basketball Men's Basketball NaN
1 2 A Lamusi M 23.0 170.0 60.0 China CHN 2012 Summer 2012 Summer London Judo Judo Men's Extra-Lightweight NaN
2 3 Gunnar Nielsen Aaby M 24.0 NaN NaN Denmark DEN 1920 Summer 1920 Summer Antwerpen Football Football Men's Football NaN
3 4 Edgar Lindenau Aabye M 34.0 NaN NaN Denmark/Sweden DEN 1900 Summer 1900 Summer Paris Tug-Of-War Tug-Of-War Men's Tug-Of-War Gold
4 5 Christine Jacoba Aaftink F 21.0 185.0 82.0 Netherlands NED 1988 Winter 1988 Winter Calgary Speed Skating Speed Skating Women's 500 metres NaN

1. How old were the youngest male and female participants of the 1996 Olympics?

  • 16 and 15
  • 14 and 12
  • 16 and 12
  • 13 and 11
In [4]:
# You code here 

2. What was the percentage of male gymnasts among all the male participants of the 2000 Olympics? Consider only Gymnastics as a target sport. Round the answer to the first decimal.

Hint: here and further if needed drop duplicated sportsmen to count only unique ones.

  • 0.2
  • 1.5
  • 2.5
  • 7.7
In [5]:
# You code here 

3. What are the mean and standard deviation of height for female basketball players participated in the 2000 Olympics? Round the answer to the first decimal.

  • 178.5 and 7.2
  • 179.4 and 10
  • 180.7 and 6.7
  • 182.4 and 9.1
In [6]:
# You code here 

4. Find a sportsperson participated in the 2002 Olympics, with the highest weight among other participants of the same Olympics. What sport did he or she do?

  • Judo
  • Bobsleigh
  • Weightlifting
  • Boxing
In [7]:
# You code here 

5. How many times did Pawe Abratkiewicz participate in the Olympics held in different years?

  • 0
  • 1
  • 2
  • 3
In [8]:
# You code here 

6. How many silver medals in tennis did sportspeople from the Australia team win at the 2000 Olympics? Count every medal from every sportsperson.

  • 0
  • 1
  • 2
  • 3
In [9]:
# You code here 

7. Is it true that Switzerland won fewer medals than Serbia at the 2016 Olympics? Do not consider NaN values in Medal column.

  • Yes
  • No
In [10]:
# You code here 

8. What age category did the fewest and the most participants of the 2014 Olympics belong to?

  • [45-55] and [25-35) correspondingly
  • [45-55] and [15-25) correspondingly
  • [35-45] and [25-35) correspondingly
  • [45-55] and [35-45) correspondingly
In [11]:
# You code here 

9. Is it true that there were Summer Olympics held in Lake Placid? Is it true that there were Winter Olympics held in Sankt Moritz?

  • Yes, Yes
  • Yes, No
  • No, Yes
  • No, No
In [12]:
# You code here 

10. What is the absolute difference between the number of unique sports at the 1996 Olympics and 2016 Olympics?

  • 3
  • 10
  • 27
  • 34
In [13]:
# You code here