-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathassignment_a.html
More file actions
223 lines (219 loc) · 11.3 KB
/
assignment_a.html
File metadata and controls
223 lines (219 loc) · 11.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><title>Python: module assignment_a</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head><body bgcolor="#f0f0f8">
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
<tr bgcolor="#7799ee">
<td valign=bottom> <br>
<font color="#ffffff" face="helvetica, arial"> <br><big><big><strong>assignment_a</strong></big></big></font></td
><td align=right valign=bottom
><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:c%3A%5Cusers%5Cfflattery%5Conedrive%20-%20athlone%20institute%20of%20technology%5Capplied%20scripting%20languages%5Cassignment%5Cassignment_a.py">c:\users\fflattery\onedrive - athlone institute of technology\applied scripting languages\assignment\assignment_a.py</a></font></td></tr></table>
<p><tt>Student ID: A00291231<br>
Purpose: Perform calcualations on single variable that has its values in a list</tt></p>
<p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#aa55cc">
<td colspan=3 valign=bottom> <br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr>
<tr><td bgcolor="#aa55cc"><tt> </tt></td><td> </td>
<td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="matplotlib.pyplot.html">matplotlib.pyplot</a><br>
</td><td width="25%" valign=top></td><td width="25%" valign=top></td><td width="25%" valign=top></td></tr></table></td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#eeaa77">
<td colspan=3 valign=bottom> <br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Functions</strong></big></font></td></tr>
<tr><td bgcolor="#eeaa77"><tt> </tt></td><td> </td>
<td width="100%"><dl><dt><a name="-boxplot"><strong>boxplot</strong></a>(height_list)</dt><dd><tt>Generate a boxplot of the heights in the list<br>
<br>
Parameters<br>
----------<br>
height_list : list[int]<br>
list of heights.<br>
<br>
Returns<br>
-------<br>
None.</tt></dd></dl>
<dl><dt><a name="-calc_correlation"><strong>calc_correlation</strong></a>(height_list, weight_list)</dt><dd><tt>Calculate the correlation between the height and weight<br>
<br>
Parameters<br>
----------<br>
height_list : list [int]<br>
list of heights.<br>
weight_list : list[int]<br>
list of weights.<br>
<br>
Returns<br>
-------<br>
correlation : float<br>
the correlation between height and weight.</tt></dd></dl>
<dl><dt><a name="-calc_iqr"><strong>calc_iqr</strong></a>(height_list)</dt><dd><tt>Get the interquartile range from the list of heights. <br>
Get the 25th percentile and the 75th percentile and subtract them to get the interquartile<br>
<br>
Parameters<br>
----------<br>
height_list : list[int]<br>
list of integers.<br>
<br>
Returns<br>
-------<br>
IQR : int<br>
the interquartile range from the list of heights.</tt></dd></dl>
<dl><dt><a name="-calc_max"><strong>calc_max</strong></a>(height_list)</dt><dd><tt>Get the maximum value from the list of heights<br>
<br>
Parameters<br>
----------<br>
height_list : list[int]<br>
List of integers.<br>
<br>
Returns<br>
-------<br>
maximum : int<br>
maximum value from the list of heights.</tt></dd></dl>
<dl><dt><a name="-calc_mean"><strong>calc_mean</strong></a>(height_list)</dt><dd><tt>Get the mean of the values from the list of heights<br>
<br>
Parameters<br>
----------<br>
height_list : list[int]<br>
List of heights.<br>
<br>
Returns<br>
-------<br>
mean_height : float<br>
the average/mean of the list of numbers.</tt></dd></dl>
<dl><dt><a name="-calc_median"><strong>calc_median</strong></a>(height_list)</dt><dd><tt>Get the median from the list of heights<br>
<br>
Parameters<br>
----------<br>
height_list : list[int]<br>
list of heights.<br>
<br>
Returns<br>
-------<br>
median : float<br>
the median value from the list of numbers.</tt></dd></dl>
<dl><dt><a name="-calc_min"><strong>calc_min</strong></a>(height_list)</dt><dd><tt>Get the minimum value from the list of heights<br>
<br>
Parameters<br>
----------<br>
height_list : list[int]<br>
list of integers.<br>
<br>
Returns<br>
-------<br>
minimum : int<br>
minimum value from the list of heights.</tt></dd></dl>
<dl><dt><a name="-calc_mode"><strong>calc_mode</strong></a>(height_list)</dt><dd><tt>Get the mode from the list of heights<br>
<br>
Parameters<br>
----------<br>
height_list : list[int]<br>
list of heights.<br>
<br>
Returns<br>
-------<br>
mode : int<br>
The mode from the list of heights.</tt></dd></dl>
<dl><dt><a name="-calc_skewness"><strong>calc_skewness</strong></a>(height_list)</dt><dd><tt>Calcualte the skewness of the data. Get the mode and median skewness <br>
<br>
Parameters<br>
----------<br>
mean_height : float<br>
average height from the height_list<br>
mode : int<br>
mode from the heightlist.<br>
std_dev : float<br>
the standard deviation of the data calculated above.<br>
median : float<br>
the median of the height_list calcualted above.<br>
<br>
Returns<br>
-------<br>
mode_skewness : float<br>
mode skewness of the data.<br>
median_skewness : float<br>
median skewness of the data.</tt></dd></dl>
<dl><dt><a name="-calc_std_dev"><strong>calc_std_dev</strong></a>(height_list)</dt><dd><tt>Get the standard deviation from the list of heights<br>
<br>
Parameters<br>
----------<br>
height_list : list[int]<br>
list of integers.<br>
<br>
Returns<br>
-------<br>
std_dev : float<br>
the standard deviation from the list of integers.</tt></dd></dl>
<dl><dt><a name="-histogram"><strong>histogram</strong></a>(height_list)</dt><dd><tt>Create a histogram of the heights<br>
<br>
Parameters<br>
----------<br>
height_list : list[int]<br>
list of heights.<br>
<br>
Returns<br>
-------<br>
None.</tt></dd></dl>
<dl><dt><a name="-number_of_values"><strong>number_of_values</strong></a>(height_list)</dt><dd><tt>Get the number of values from the height list <br>
<br>
Parameters<br>
----------<br>
height_list : list[int]<br>
list of heights.<br>
<br>
Returns<br>
-------<br>
int<br>
the number of values in the list.</tt></dd></dl>
<dl><dt><a name="-scatterplot"><strong>scatterplot</strong></a>(height_list, weight_list)</dt><dd><tt>Generate a scatterplot of the heights in the list<br>
<br>
Parameters<br>
----------<br>
height_list : list[int]<br>
list of heights.<br>
<br>
Returns<br>
-------<br>
None.</tt></dd></dl>
<dl><dt><a name="-sqrt"><strong>sqrt</strong></a>(x, /)</dt><dd><tt>Return the square root of x.</tt></dd></dl>
<dl><dt><a name="-total_height"><strong>total_height</strong></a>(height_list)</dt><dd><tt>Get the total height of everyone in the list of heights<br>
<br>
Parameters<br>
----------<br>
height_list : list[int]<br>
List of heights.<br>
<br>
Returns<br>
-------<br>
int<br>
the sum of all the heights in the list.</tt></dd></dl>
<dl><dt><a name="-violinplot"><strong>violinplot</strong></a>(height_list)</dt><dd><tt>Generate a violin plot of the ist of heights in the list<br>
<br>
Parameters<br>
----------<br>
height_list : list[int]<br>
list of heights.<br>
<br>
Returns<br>
-------<br>
None.</tt></dd></dl>
</td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#55aa55">
<td colspan=3 valign=bottom> <br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Data</strong></big></font></td></tr>
<tr><td bgcolor="#55aa55"><tt> </tt></td><td> </td>
<td width="100%"><strong>bDay</strong> = '12/30/1984'<br>
<strong>country</strong> = 'USA<font color="#c040c0">\n</font>'<br>
<strong>data_file</strong> = <_io.TextIOWrapper name='nba2k20_players.csv' mode='r' encoding='cp1252'><br>
<strong>fullName</strong> = 'LeBron James'<br>
<strong>headers</strong> = 'fullName,rating,jersey,team,bDay,height,weight,salary,country<font color="#c040c0">\n</font>'<br>
<strong>height</strong> = '206'<br>
<strong>height_list</strong> = [213, 203, 196, 196, 185, 201, 198, 206, 191, 211, 191, 196, 208, 201, 203, 180, 185, 213, 213, 188, ...]<br>
<strong>jersey</strong> = '23'<br>
<strong>line</strong> = 'LeBron James,97,23,Los Angeles Lakers,12/30/1984,206,250,37436858,USA<font color="#c040c0">\n</font>'<br>
<strong>rating</strong> = '97'<br>
<strong>salary</strong> = '37436858'<br>
<strong>team</strong> = 'Los Angeles Lakers'<br>
<strong>weight</strong> = '250'<br>
<strong>weight_list</strong> = [235, 240, 200, 225, 175, 250, 225, 246, 180, 230, 190, 195, 260, 209, 225, 180, 185, 265, 255, 190, ...]</td></tr></table>
</body></html>