# Midterm Review Worksheet Solutions.pdf - Data 8 Fall 2018...

• Test Prep
• 11
• 100% (9) 9 out of 9 people found this document helpful

This preview shows page 1 - 4 out of 11 pages.

The preview shows page 3 - 4 out of 11 pages.
Data 8 Fall 2018Discussion: Midterm ReviewCoding PracticeYou are given the following table calledpokemon.For the following questions, fill in the blanks.1. Find the name of pokemon of typeWaterthat has the highestHP.
water_pokemon.________(__________,____________).column("Name").item(0)
2. Find the proportion of pokemon of typeFirein the dataset whoseSpeedis strictly less than 100.
3. Return a table containingTypeandGenerationthat is sorted in decreasing order by theaverageHPfor each pair ofTypeandGeneration.
d = pokemon.____________(________________________,______________)d.sort("HP mean",__________________).________(________,____________)d = pokemon.group(["Type", "Generation"], np.mean)d.sort("HP mean", descending=True).select("Type", "Generation")4. Find the largest difference of average HP between consecutive generations of Pokemongeneration = pokemon.________(______________,___________)\.sort("Generation",descending=False)________(np.diff(______________._________("HP mean")))generation = pokemon.group("Generation",np.mean) \ .sort("Generation",descending=False)np.max(np.diff(generation.column("HP mean"))) #5. Return an array that contains ratios of legendary to non-legendary pokemons for each generation.t = pokemon._____________(________________,_________________)ratio = t.____________(______________)/t.____________(____________)t = pokemon.pivot("Legendary", "Generation")ratio = t.column("True")/t.column("False")Histogram Practice (Midterm Spring 2017)Galton measured the heights of the members of200 familiesthat each included 1 mother, 1 father,and some varying number of adult sons. The three histograms of heights below depict thedistributions for all mothers, fathers, and adult sons. All bars are 2 inches wide. All bar heights areintegers. The heights of all people in the data set are included in the histograms.
1. Calculate each quantity described below or writeUnknownif there is not enough information aboveto express the quantity as a single number (not a range). Show your work!a. Thepercentageof mothers that are at least 60 inches but less than 64 inches tall.
b. Thepercentageof fathers that are at least 64 inches but less than 67 inches tall.
c. Thenumberof sons that are at least 70 inches tall.

Upload your study docs or become a

Course Hero member to access this document

Upload your study docs or become a

Course Hero member to access this document

End of preview. Want to read all 11 pages?

Upload your study docs or become a

Course Hero member to access this document

Term
Fall
Professor