forked from data-8/data-8.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ref.html
295 lines (289 loc) · 12.8 KB
/
ref.html
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
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
<!DOCTYPE html PUBLIC "-//w3c//dtd html 4.0 transitional//en">
<html lang="en">
<head>
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
<link rel="icon" href="favicon.ico" type="image/x-icon">
<meta charset="UTF-8" />
<meta http-equiv="Pragma" content="no-cache">
<title>Data 8</title>
<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<link rel="stylesheet" type="text/css" href="./assets/css/mono-blue.css">
<link rel="stylesheet" type="text/css" href="./assets/css/custom.css"
</head>
<body id="index" class="home">
<nav class="navbar navbar-default navbar-fixed-top">
<div class="container">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar-collapse-section">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="index.html">Data 8</a>
</div>
<div class="collapse navbar-collapse" id="navbar-collapse-section">
<ul class="nav navbar-nav">
<li><a href="weekly.html">Weekly Schedule</a></li>
<li><a href="info.html">Course Info</a></li>
<li><a href="http://www.data8.org/connector">Connector Courses</a></li>
<li><a href="staff.html">Staff</a></li>
<li class="dropdown"><a class="dropdown-toggle" data-toggle="dropdown" href="#">Python Help <span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="http://www.data8.org/datascience">Docs</a></li>
<li><a href="ref.html">Reference Page</a></li>
<li><a href="https://data8.berkeley.edu/hub/interact?file=http://data8.org/fa16/notebooks/playground.ipynb">Python Playground</a></li>
</ul>
<li><a href="http://data8.org/fa16/review.html">Review</a></li>
</li> <!-- Documentation, python playground, Interact button does, what random stuff does!!! -->
</ul>
</div>
</div>
</nav>
<div id="content" class="container">
<h3>Table Functions and Methods</h3>
<table class="table table-striped table-bordered"> <tbody>
<tr>
<td>Name</td>
<td>Chapter</td>
<td>Description</td>
</tr>
<tr>
<td><code>Table</code></td>
<td><a href="https://www.inferentialthinking.com/chapters/05/tables.html">5</a></td>
<td>Create an empty table, usually to extend with data</td>
</tr>
<tr>
<td><code>Table.read_table</code></td>
<td><a href="https://www.inferentialthinking.com/chapters/05/tables.html">5</a></td>
<td>Create a table from a data file</td>
</tr>
<tr>
<td><code>with_columns</code></td>
<td><a href="https://www.inferentialthinking.com/chapters/05/tables.html">5</a></td>
<td>Create a copy of a table with more columns</td>
</tr>
<tr>
<td><code>column</code></td>
<td><a href="https://www.inferentialthinking.com/chapters/05/tables.html">5</a></td>
<td>Create an array containing the elements of a column</td>
</tr>
<tr>
<td><code>num_rows</code></td>
<td><a href="https://www.inferentialthinking.com/chapters/05/tables.html">5</a></td>
<td>Compute the number of rows in a table</td>
</tr>
<tr>
<td><code>num_columns</code></td>
<td><a href="https://www.inferentialthinking.com/chapters/05/tables.html">5</a></td>
<td>Compute the number of columns in a table</td>
</tr>
<tr>
<td><code>labels</code></td>
<td><a href="https://www.inferentialthinking.com/chapters/05/tables.html">5</a></td>
<td>Lists the column labels in a table</td>
</tr>
<tr>
<td><code>select</code></td>
<td><a href="https://www.inferentialthinking.com/chapters/05/tables.html">5</a></td>
<td>Create a copy of a table with only some of the columns</td>
</tr>
<tr>
<td><code>drop</code></td>
<td><a href="https://www.inferentialthinking.com/chapters/05/tables.html">5</a></td>
<td>Create a copy of a table without some of the columns</td>
</tr>
<tr>
<td><code>relabel</code></td>
<td><a href="https://www.inferentialthinking.com/chapters/05/tables.html">5</a></td>
<td>Modifies the existing table <em>in place</em>, changing the column heading in the first argument to the second</td>
</tr>
<tr>
<td><code>relabeled</code></td>
<td><a href="https://www.inferentialthinking.com/chapters/05/tables.html">5</a></td>
<td>Returns a new table with the column heading in the first argument changed to the second</td>
</tr>
<tr>
<td><code>sort</code></td>
<td><a href="https://www.inferentialthinking.com/chapters/05/2/sorting-rows.html">5.2</a></td>
<td>Create a copy of a table sorted by the values in a column. Defaults to ascending order unless “descending = True” is included</td>
</tr>
<tr>
<td><code>where</code></td>
<td><a href="https://www.inferentialthinking.com/chapters/05/3/selecting-rows.html">5.3</a></td>
<td>Create a copy of a table with only the rows that match some <em>predicate</em></td>
</tr>
<tr>
<td><code>take</code></td>
<td><a href="https://www.inferentialthinking.com/chapters/05/3/selecting-rows.html">5.3</a></td>
<td>Create a copy of the table with only the rows whose indices are in the given array</td>
</tr>
<td><code>barh</code></td>
<td><a href="https://www.inferentialthinking.com/chapters/06/1/visualizing-categorical-distributions.html">6.1</a></td>
<td>Draws a bar chart of the frequencies of a categorical distribution</td>
</tr>
<tr>
<td><code>histogram</code></td>
<td><a href="https://www.inferentialthinking.com/chapters/06/2/visualizing-numerical-distributions.html">6.2</a></td>
<td>Draws a histogram of a numerical distribution</td>
</tr>
<tr>
<td><code>apply</code></td>
<td><a href="https://www.inferentialthinking.com/chapters/07/1/applying-a-function-to-a-column.html">7.1</a></td>
<td>Returns an array of a a function applied to some row in a table</td>
</tr>
<tr>
<td><code>group</code></td>
<td><a href="https://www.inferentialthinking.com/chapters/07/2/classifying-by-one-variable.html">7.2</a></td>
<td>Create a copy of the table with all rows with the same values in a certain column aggregated into one row in the new table</td>
</tr>
<tr>
<td><code>groups</code></td>
<td><a href="https://www.inferentialthinking.com/chapters/07/3/cross-classifying-by-more-than-one-variable.html">7.3</a></td>
<td>Create a copy of the table with all rows with the same value in a certain array of columns aggregated into one row in the new table</td>
</tr>
<tr>
<td><code>pivot</code></td>
<td><a href="https://www.inferentialthinking.com/chapters/07/3/cross-classifying-by-more-than-one-variable.html">7.3</a></td>
<td>Create a copy of the table with a column for each element in the first argument and a row for each element in the second argument and aggregates values</td>
</tr>
<tr>
<td><code>join</code></td>
<td><a href="https://www.inferentialthinking.com/chapters/07/4/joining-tables-by-columns.html">7.4</a></td>
<td>Create a copy of the table that is the result of joining the columns of two tables, with a row for each shared value in the two tables</td>
</tr>
<tr>
<td><code>sample</code></td>
<td><a href="https://www.inferentialthinking.com/chapters/09/empirical-distributions.html">9</a></td>
<td>
Draws some number of rows at random from a table. By default, with replacement.
</td>
</tr>
<tr>
<td><code>proportion_from_distribution</code></td>
<td><a href="https://www.inferentialthinking.com/chapters/10/1/jury-selection.html">10.1</a></td>
<td>
Returns a new table with an additional column corresponding to proportions from a random sample of some size of the proportions in a column.
</td>
</tr>
</tbody>
</table>
<h3>Array Functions and Methods</h3>
<table class="table table-striped table-bordered">
<tbody>
<tr>
<td>Name</td>
<td>Chapter</td>
<td>Description</td>
</tr>
<tr>
<td><code>max</code></td>
<td><a href="https://www.inferentialthinking.com/chapters/03/3/call-expressions.html">3.3</a></td>
<td>Returns the maximum value of an array</td>
</tr>
<tr>
<td><code>min</code></td>
<td><a href="https://www.inferentialthinking.com/chapters/03/3/call-expressions.html">3.3</a></td>
<td>Returns the minimum value of an array</td>
</tr>
<tr>
<td><code>sum</code></td>
<td><a href="https://www.inferentialthinking.com/chapters/03/3/call-expressions.html">3.3</a></td>
<td>Returns the sum of the values in an array</td>
</tr>
<tr>
<td><code>len</code></td>
<td><a href="https://www.inferentialthinking.com/chapters/03/3/call-expressions.html">3.3</a></td>
<td>Returns the length (number of elements) of an array</td>
</tr>
<tr>
<td><code>make_array</code></td>
<td><a href="https://www.inferentialthinking.com/chapters/04/4/arrays.html">4.4</a></td>
<td>Makes a numpy array with the values passed in</td>
</tr>
<tr>
<td><code>np.average</code></td>
<td><a href="https://www.inferentialthinking.com/chapters/04/4/arrays.html">4.4</a></td>
<td>Returns the mean value of an array</td>
</tr>
<tr>
<td>
<code>np.std</code>
</td>
<td>
<a href="https://www.inferentialthinking.com/chapters/12/2/variability.html">12.2</a>
</td>
<td>
Returns the standard deviation of an array of numbers
</td>
</tr>
<tr>
<td><code>np.diff</code></td>
<td><a href="https://www.inferentialthinking.com/chapters/04/4/arrays.html">4.4</a></td>
<td>Returns a new array of size len(arr)-1 with elements equal to the difference between adjacent elements</td>
</tr>
<tr>
<td><code>np.sqrt</code></td>
<td><a href="https://www.inferentialthinking.com/chapters/04/4/arrays.html">4.4</a></td>
<td>Returns an array with the square root of each element</td>
</tr>
<tr>
<td><code>np.arange</code></td>
<td><a href="https://www.inferentialthinking.com/chapters/04/5/ranges.html">4.5</a></td>
<td>Returns an array of an end-exclusive range of variable step size</td>
</tr>
<tr>
<td><code>arr.item</code></td>
<td><a href="https://www.inferentialthinking.com/chapters/04/6/more-on-arrays.html">4.6</a></td>
<td>Returns the i-th item in an array (remember Python indices start at 0!)</td>
</tr>
<tr>
<td>
<code>np.random.choice</code>
</td>
<td>
<a href="https://www.inferentialthinking.com/chapters/08/randomness.html">8</a>
</td>
<td>
Picks one (by default) or some number 'n' of items from an array at random. By default, with replacement.
</td>
</tr>
<tr>
<td>
<code>np.count_nonzero</code>
</td>
<td>
<a href="https://www.inferentialthinking.com/chapters/08/randomness.html">8</a>
</td>
<td>
Returns the number of non-zero (or True) elements in an array.
</td>
</tr>
<tr>
<td>
<code>np.append</code>
</td>
<td>
<a href="https://www.inferentialthinking.com/chapters/08/2/iteration.html">8.2</a>
</td>
<td>
Returns a copy of the input array with some item (must be the same type as the other entries in the array) appended to the end.
</td>
</tr>
<tr>
<td>
<code>percentile</code>
</td>
<td>
<a href="https://www.inferentialthinking.com/chapters/11/1/percentiles.html">11.1</a>
</td>
<td>
Returns the corresponding percentile of an array.
</td>
</tr>
</tbody>
</table>
</div>
</body>