DS100
DS100
3 DS100-1
APPLIED DATA SCIENCE
PYTHON DATA SCIENCE TOOLBOX
Name: BRIXTER JAMES Q ICMAT
Page 1 of 5
Write codes in Jupyter notebook as required by the problems. Copy both code and output as screen grab or screen shot and paste
them here.
1 Create a list of lists. The individual lists should contain, in the correct order, the weight (in pounds), the height (in inches)
and the age of the baseball players.
Weights: 180 215 210 210 188 176 209 200 231 180 188 180 185 160 180 185 189 185 219 230
Heights: 74 74 72 72 73 69 69 71 76 71 73 73 74 74 69 70 73 75 78 79
Ages: 23 35 31 36 24 30 31 36 31 28 24 27 24 27 28 35 28 23 23 26
Convert the list of lists into a NumPy array named np_baseball. Using NumPy functionality, convert the unit of weight
to kg and the height to m. Print the resulting array.
Code and Output
2 Refer to the code in #1. Write a code that determines the age of the 3rd player. The output should be in the following
form:
The 3rd player is <age> years old.
Code and Output
Page 1 of 5
3 Refer to the code in #1. Print out the ages of the old players (30 years and above).
Code and Output
4 Create a line plot showing the yearly CO2 emissions per person in Thailand. Make sure to add labels and a title to your plot.
Page 2 of 5
Page 3 of 5
5 Based on the plot, in approximately what year will the population
reach ten billion?
2060
6 Visualize Population as a function of GDP per Capita for the following South East Asia countries. Use Child Mortality as an
additional argument. Do not forget to label the axes and to add a title.
7 Import cars.csv. Use the country abbreviations as index. Print the first three lines. Create a code that prints out the
country name and the number of cars per capita for Japan, India and Russia.
Page 4 of 5
Code and Output
8 Refer to the cars dataset. Create a code that prints out the observations for the countries that drive on the left side of the
road.
Code and Output
Page 5 of 5