Using Python : In this project you will do a simple analysis of three datasets c
ID: 3879728 • Letter: U
Question
Using Python:
In this project you will do a simple analysis of three datasets containing height data that you will find in the datasets folder on the Canvas site. The first dataset (hopeheights.dat) is heights of college students at Hope College. The first column of this data is the gender of the subject (1 female, 2 male) and the second column is the height in inches. See pythonstart.py to see how to load a file with multiple columns. Alternatively, you can tell numpy.loadtxt which columns of the datafile you want to load. Google numpy.loadtxt to see how to do this. The second data set (BBhtwt.dat) contains heights (in inches) and weights (in lbs) of professional baseball players. The third data set (Bigheightwt.dat) is the heights (in inches) and weights (in lbs) of 25,000 adolescents and various ages and both genders. This assignment is to first calculate the mean and the standard deviations for the height data in each of the three data sets.
Here are some of the first 5 data from files:
1. 67
1. 67
1. 67
1. 60
1. 68
height
74
74
72
72
73
weight
180
215
210
210
188
height
65.78331
71.51521
69.39874
68.2166
67.78781
weight
112.9925
136.4873
153.0269
142.3354
144.2971
hopeheights.dat BBhtwt.dat BBhtwt.dat) Bigheightwt.dat Bigheightwt.dat1. 67
1. 67
1. 67
1. 60
1. 68
height
74
74
72
72
73
weight
180
215
210
210
188
height
65.78331
71.51521
69.39874
68.2166
67.78781
weight
112.9925
136.4873
153.0269
142.3354
144.2971
Explanation / Answer
heightavg1=a['height'].mean()
heightstd1=a['height'].std()
heightavg2=b['height'].mean()
heightstd2=b['height'].std()
heightavg3=c['height'].mean()
heightstd3=c['height'].std()
print(heightavg1)
print(heightstd1)
print(heightavg2)
print(heightstd2)
print(heightavg3)
print(heightstd3)
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.