Chp 10 Flashcards
Quiz-07 - Data wrangling using pandas
Given the following DataFrame named oo , which three countries have won the most medals in recent years (from 1984 to 2008)?
Fill the blank.
rec = oo[oo.Edition >= 1984]
rec[“NOC”]._______.head(3)
value_counts()
Given the following DataFrame named oo, list only the NOC column.
oo[‘NOC’]
oo.NOC
oo.iloc[:,5]
oo[“NOC”]
Given the following DataFrame named oo , list the total number of medals awarded at each of the Olympic games throughout history.
Fill the blank.
oo.groupby(_____).size()
‘Edition’
“Edition”
Given the following DataFrame named oo , in which events did “HERSCHMANN, Otto” win a medal?
Fill the blank.
oo[________][‘Event’]
oo.Athlete == ‘“HERSCHMANN, Otto”
oo.Athlete == ‘HERSCHMANN, Otto’
oo[“Athlete”] == ‘HERSCHMANN, Otto’
oo[‘Athlete’] == ‘HERSCHMANN, Otto’
oo[‘Athlete’] == “HERSCHMANN, Otto”
oo[“Athlete”] == “HERSCHMANN, Otto”
oo.Athlete.str.contains(‘HERSCHMANN, Otto’)
oo.Athlete.str.contains(“HERSCHMANN, Otto”)
oo[“Athlete”].str.contains(“HERSCHMANN, Otto”)
oo[‘Athlete’].str.contains(“HERSCHMANN, Otto”)
oo[“Athlete”].str.contains(‘HERSCHMANN, Otto’)
oo[‘Athlete’].str.contains(‘HERSCHMANN, Otto’)
oo.Athlete==’“HERSCHMANN, Otto”
oo.Athlete==’HERSCHMANN, Otto’
oo[“Athlete”]==’HERSCHMANN, Otto’
oo[‘Athlete’]==’HERSCHMANN, Otto’
oo[‘Athlete’]==”HERSCHMANN, Otto”
oo[“Athlete”]==”HERSCHMANN, Otto”
Given the following DataFrame named oo , list the total number of medals won for each country for each year over the history of the Olympics.
oo.groupby(____).size()
[‘Edition’, ‘NOC’]
[‘Edition’, ‘“NOC”]
[“Edition”, ‘NOC’]
[“Edition”, “NOC”]
[‘NOC’, ‘Edition’]
[‘“NOC”, ‘Edition’]
[‘NOC’, “Edition”]
[“NOC”, “Edition”]