-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathsoftware-installation.html
More file actions
386 lines (345 loc) · 34.6 KB
/
software-installation.html
File metadata and controls
386 lines (345 loc) · 34.6 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
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
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
<!DOCTYPE html>
<html >
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Python Basics for Data Science</title>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
<meta name="description" content="Introductory Python materials for the INFO 370: Introduction to Data Science Course. Compiled by Michael Freeman.">
<meta name="generator" content="bookdown 0.3 and GitBook 2.6.7">
<meta property="og:title" content="Python Basics for Data Science" />
<meta property="og:type" content="book" />
<meta property="og:description" content="Introductory Python materials for the INFO 370: Introduction to Data Science Course. Compiled by Michael Freeman." />
<meta name="github-repo" content="rstudio/bookdown-demo" />
<meta name="twitter:card" content="summary" />
<meta name="twitter:title" content="Python Basics for Data Science" />
<meta name="twitter:description" content="Introductory Python materials for the INFO 370: Introduction to Data Science Course. Compiled by Michael Freeman." />
<meta name="author" content="Joel Ross">
<meta name="date" content="2018-01-03">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<link rel="prev" href="index.html">
<link rel="next" href="functions.html">
<script src="libs/jquery-2.2.3/jquery.min.js"></script>
<link href="libs/gitbook-2.6.7/css/style.css" rel="stylesheet" />
<link href="libs/gitbook-2.6.7/css/plugin-bookdown.css" rel="stylesheet" />
<link href="libs/gitbook-2.6.7/css/plugin-highlight.css" rel="stylesheet" />
<link href="libs/gitbook-2.6.7/css/plugin-search.css" rel="stylesheet" />
<link href="libs/gitbook-2.6.7/css/plugin-fontsettings.css" rel="stylesheet" />
<style type="text/css">
div.sourceCode { overflow-x: auto; }
table.sourceCode, tr.sourceCode, td.lineNumbers, td.sourceCode {
margin: 0; padding: 0; vertical-align: baseline; border: none; }
table.sourceCode { width: 100%; line-height: 100%; }
td.lineNumbers { text-align: right; padding-right: 4px; padding-left: 4px; color: #aaaaaa; border-right: 1px solid #aaaaaa; }
td.sourceCode { padding-left: 5px; }
code > span.kw { color: #007020; font-weight: bold; } /* Keyword */
code > span.dt { color: #902000; } /* DataType */
code > span.dv { color: #40a070; } /* DecVal */
code > span.bn { color: #40a070; } /* BaseN */
code > span.fl { color: #40a070; } /* Float */
code > span.ch { color: #4070a0; } /* Char */
code > span.st { color: #4070a0; } /* String */
code > span.co { color: #60a0b0; font-style: italic; } /* Comment */
code > span.ot { color: #007020; } /* Other */
code > span.al { color: #ff0000; font-weight: bold; } /* Alert */
code > span.fu { color: #06287e; } /* Function */
code > span.er { color: #ff0000; font-weight: bold; } /* Error */
code > span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warning */
code > span.cn { color: #880000; } /* Constant */
code > span.sc { color: #4070a0; } /* SpecialChar */
code > span.vs { color: #4070a0; } /* VerbatimString */
code > span.ss { color: #bb6688; } /* SpecialString */
code > span.im { } /* Import */
code > span.va { color: #19177c; } /* Variable */
code > span.cf { color: #007020; font-weight: bold; } /* ControlFlow */
code > span.op { color: #666666; } /* Operator */
code > span.bu { } /* BuiltIn */
code > span.ex { } /* Extension */
code > span.pp { color: #bc7a00; } /* Preprocessor */
code > span.at { color: #7d9029; } /* Attribute */
code > span.do { color: #ba2121; font-style: italic; } /* Documentation */
code > span.an { color: #60a0b0; font-weight: bold; font-style: italic; } /* Annotation */
code > span.cv { color: #60a0b0; font-weight: bold; font-style: italic; } /* CommentVar */
code > span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Information */
</style>
<link rel="stylesheet" href="style.css" type="text/css" />
</head>
<body>
<div class="book without-animation with-summary font-size-2 font-family-1" data-basepath=".">
<div class="book-summary">
<nav role="navigation">
<ul class="summary">
<li><a href="./">Python Basics for Data Science</a></li>
<li class="divider"></li>
<li class="chapter" data-level="" data-path="index.html"><a href="index.html"><i class="fa fa-check"></i>About the book</a></li>
<li class="chapter" data-level="1" data-path="software-installation.html"><a href="software-installation.html"><i class="fa fa-check"></i><b>1</b> Software Installation</a><ul>
<li class="chapter" data-level="1.1" data-path="software-installation.html"><a href="software-installation.html#summary"><i class="fa fa-check"></i><b>1.1</b> Summary</a></li>
<li class="chapter" data-level="1.2" data-path="software-installation.html"><a href="software-installation.html#r"><i class="fa fa-check"></i><b>1.2</b> R</a></li>
<li class="chapter" data-level="1.3" data-path="software-installation.html"><a href="software-installation.html#rstudio"><i class="fa fa-check"></i><b>1.3</b> RStudio</a></li>
<li class="chapter" data-level="1.4" data-path="software-installation.html"><a href="software-installation.html#anaconda-python"><i class="fa fa-check"></i><b>1.4</b> Anaconda (Python)</a></li>
<li class="chapter" data-level="1.5" data-path="software-installation.html"><a href="software-installation.html#git"><i class="fa fa-check"></i><b>1.5</b> Git</a></li>
<li class="chapter" data-level="1.6" data-path="software-installation.html"><a href="software-installation.html#command-line-tools-windows"><i class="fa fa-check"></i><b>1.6</b> Command-line Tools (Windows)</a><ul>
<li class="chapter" data-level="1.6.1" data-path="software-installation.html"><a href="software-installation.html#git-bash"><i class="fa fa-check"></i><b>1.6.1</b> Git Bash</a></li>
<li class="chapter" data-level="1.6.2" data-path="software-installation.html"><a href="software-installation.html#windows-bash"><i class="fa fa-check"></i><b>1.6.2</b> Windows Bash</a></li>
<li class="chapter" data-level="1.6.3" data-path="software-installation.html"><a href="software-installation.html#powershell-windows-management-framework"><i class="fa fa-check"></i><b>1.6.3</b> Powershell (Windows Management Framework)</a></li>
</ul></li>
<li class="chapter" data-level="1.7" data-path="software-installation.html"><a href="software-installation.html#text-editors"><i class="fa fa-check"></i><b>1.7</b> Text Editors</a><ul>
<li class="chapter" data-level="1.7.1" data-path="software-installation.html"><a href="software-installation.html#visual-studio-code"><i class="fa fa-check"></i><b>1.7.1</b> Visual Studio Code</a></li>
<li class="chapter" data-level="1.7.2" data-path="software-installation.html"><a href="software-installation.html#sublimetext"><i class="fa fa-check"></i><b>1.7.2</b> SublimeText</a></li>
<li class="chapter" data-level="1.7.3" data-path="software-installation.html"><a href="software-installation.html#atom"><i class="fa fa-check"></i><b>1.7.3</b> Atom</a></li>
</ul></li>
<li class="chapter" data-level="1.8" data-path="software-installation.html"><a href="software-installation.html#resources"><i class="fa fa-check"></i><b>1.8</b> Resources</a></li>
</ul></li>
<li class="chapter" data-level="2" data-path="functions.html"><a href="functions.html"><i class="fa fa-check"></i><b>2</b> Functions</a><ul>
<li class="chapter" data-level="2.1" data-path="functions.html"><a href="functions.html#resources-1"><i class="fa fa-check"></i><b>2.1</b> Resources</a></li>
<li class="chapter" data-level="2.2" data-path="functions.html"><a href="functions.html#what-are-functions"><i class="fa fa-check"></i><b>2.2</b> What are Functions?</a></li>
<li class="chapter" data-level="2.3" data-path="functions.html"><a href="functions.html#python-function-syntax"><i class="fa fa-check"></i><b>2.3</b> Python Function Syntax</a><ul>
<li class="chapter" data-level="2.3.1" data-path="functions.html"><a href="functions.html#object-methods"><i class="fa fa-check"></i><b>2.3.1</b> Object Methods</a></li>
</ul></li>
<li class="chapter" data-level="2.4" data-path="functions.html"><a href="functions.html#built-in-python-functions"><i class="fa fa-check"></i><b>2.4</b> Built-in Python Functions</a><ul>
<li class="chapter" data-level="2.4.1" data-path="functions.html"><a href="functions.html#modules-and-libraries"><i class="fa fa-check"></i><b>2.4.1</b> Modules and Libraries</a></li>
</ul></li>
<li class="chapter" data-level="2.5" data-path="functions.html"><a href="functions.html#writing-functions"><i class="fa fa-check"></i><b>2.5</b> Writing Functions</a><ul>
<li class="chapter" data-level="2.5.1" data-path="functions.html"><a href="functions.html#doc-strings"><i class="fa fa-check"></i><b>2.5.1</b> Doc Strings</a></li>
</ul></li>
</ul></li>
<li class="chapter" data-level="3" data-path="introduction-to-python.html"><a href="introduction-to-python.html"><i class="fa fa-check"></i><b>3</b> Introduction to Python</a><ul>
<li class="chapter" data-level="3.1" data-path="introduction-to-python.html"><a href="introduction-to-python.html#resources-2"><i class="fa fa-check"></i><b>3.1</b> Resources</a></li>
<li class="chapter" data-level="3.2" data-path="introduction-to-python.html"><a href="introduction-to-python.html#programming-with-python"><i class="fa fa-check"></i><b>3.2</b> Programming with Python</a><ul>
<li class="chapter" data-level="3.2.1" data-path="introduction-to-python.html"><a href="introduction-to-python.html#versions"><i class="fa fa-check"></i><b>3.2.1</b> Versions</a></li>
</ul></li>
<li class="chapter" data-level="3.3" data-path="introduction-to-python.html"><a href="introduction-to-python.html#running-python-scripts"><i class="fa fa-check"></i><b>3.3</b> Running Python Scripts</a><ul>
<li class="chapter" data-level="3.3.1" data-path="introduction-to-python.html"><a href="introduction-to-python.html#command-line"><i class="fa fa-check"></i><b>3.3.1</b> Command-Line</a></li>
<li class="chapter" data-level="3.3.2" data-path="introduction-to-python.html"><a href="introduction-to-python.html#jupyter-notebooks"><i class="fa fa-check"></i><b>3.3.2</b> Jupyter Notebooks</a></li>
</ul></li>
<li class="chapter" data-level="3.4" data-path="introduction-to-python.html"><a href="introduction-to-python.html#python-basics"><i class="fa fa-check"></i><b>3.4</b> Python Basics</a></li>
<li class="chapter" data-level="3.5" data-path="introduction-to-python.html"><a href="introduction-to-python.html#comments"><i class="fa fa-check"></i><b>3.5</b> Comments</a></li>
<li class="chapter" data-level="3.6" data-path="introduction-to-python.html"><a href="introduction-to-python.html#variables"><i class="fa fa-check"></i><b>3.6</b> Variables</a><ul>
<li class="chapter" data-level="3.6.1" data-path="introduction-to-python.html"><a href="introduction-to-python.html#data-types"><i class="fa fa-check"></i><b>3.6.1</b> Data Types</a></li>
</ul></li>
<li class="chapter" data-level="3.7" data-path="introduction-to-python.html"><a href="introduction-to-python.html#getting-help"><i class="fa fa-check"></i><b>3.7</b> Getting Help</a></li>
</ul></li>
<li class="chapter" data-level="4" data-path="logic-and-conditionals.html"><a href="logic-and-conditionals.html"><i class="fa fa-check"></i><b>4</b> Logic and Conditionals</a><ul>
<li class="chapter" data-level="4.1" data-path="logic-and-conditionals.html"><a href="logic-and-conditionals.html#resources-3"><i class="fa fa-check"></i><b>4.1</b> Resources</a></li>
<li class="chapter" data-level="4.2" data-path="logic-and-conditionals.html"><a href="logic-and-conditionals.html#booleans"><i class="fa fa-check"></i><b>4.2</b> Booleans</a><ul>
<li class="chapter" data-level="4.2.1" data-path="logic-and-conditionals.html"><a href="logic-and-conditionals.html#boolean-operators"><i class="fa fa-check"></i><b>4.2.1</b> Boolean Operators</a></li>
</ul></li>
<li class="chapter" data-level="4.3" data-path="logic-and-conditionals.html"><a href="logic-and-conditionals.html#conditional-statements"><i class="fa fa-check"></i><b>4.3</b> Conditional Statements</a><ul>
<li class="chapter" data-level="4.3.1" data-path="logic-and-conditionals.html"><a href="logic-and-conditionals.html#designing-conditions"><i class="fa fa-check"></i><b>4.3.1</b> Designing Conditions</a></li>
<li class="chapter" data-level="4.3.2" data-path="logic-and-conditionals.html"><a href="logic-and-conditionals.html#modules-vs.scripts"><i class="fa fa-check"></i><b>4.3.2</b> Modules vs. Scripts</a></li>
</ul></li>
</ul></li>
<li class="chapter" data-level="5" data-path="iteration-and-loops.html"><a href="iteration-and-loops.html"><i class="fa fa-check"></i><b>5</b> Iteration and Loops</a><ul>
<li class="chapter" data-level="5.1" data-path="iteration-and-loops.html"><a href="iteration-and-loops.html#resources-4"><i class="fa fa-check"></i><b>5.1</b> Resources</a></li>
<li class="chapter" data-level="5.2" data-path="iteration-and-loops.html"><a href="iteration-and-loops.html#while-loops"><i class="fa fa-check"></i><b>5.2</b> While Loops</a><ul>
<li class="chapter" data-level="5.2.1" data-path="iteration-and-loops.html"><a href="iteration-and-loops.html#counting-and-loops"><i class="fa fa-check"></i><b>5.2.1</b> Counting and Loops</a></li>
<li class="chapter" data-level="5.2.2" data-path="iteration-and-loops.html"><a href="iteration-and-loops.html#conditionals-and-sentinels"><i class="fa fa-check"></i><b>5.2.2</b> Conditionals and Sentinels</a></li>
</ul></li>
<li class="chapter" data-level="5.3" data-path="iteration-and-loops.html"><a href="iteration-and-loops.html#for-loops"><i class="fa fa-check"></i><b>5.3</b> For Loops</a><ul>
<li class="chapter" data-level="5.3.1" data-path="iteration-and-loops.html"><a href="iteration-and-loops.html#difference-from-while-loops"><i class="fa fa-check"></i><b>5.3.1</b> Difference from While Loops</a></li>
</ul></li>
<li class="chapter" data-level="5.4" data-path="iteration-and-loops.html"><a href="iteration-and-loops.html#working-with-files"><i class="fa fa-check"></i><b>5.4</b> Working with Files</a><ul>
<li class="chapter" data-level="5.4.1" data-path="iteration-and-loops.html"><a href="iteration-and-loops.html#tryexcept"><i class="fa fa-check"></i><b>5.4.1</b> Try/Except</a></li>
</ul></li>
</ul></li>
<li class="chapter" data-level="6" data-path="lists-and-sequences.html"><a href="lists-and-sequences.html"><i class="fa fa-check"></i><b>6</b> Lists and Sequences</a><ul>
<li class="chapter" data-level="6.1" data-path="lists-and-sequences.html"><a href="lists-and-sequences.html#resources-5"><i class="fa fa-check"></i><b>6.1</b> Resources</a></li>
<li class="chapter" data-level="6.2" data-path="lists-and-sequences.html"><a href="lists-and-sequences.html#lists"><i class="fa fa-check"></i><b>6.2</b> Lists</a><ul>
<li class="chapter" data-level="6.2.1" data-path="lists-and-sequences.html"><a href="lists-and-sequences.html#list-indices"><i class="fa fa-check"></i><b>6.2.1</b> List Indices</a></li>
</ul></li>
<li class="chapter" data-level="6.3" data-path="lists-and-sequences.html"><a href="lists-and-sequences.html#list-operations-and-methods"><i class="fa fa-check"></i><b>6.3</b> List Operations and Methods</a><ul>
<li class="chapter" data-level="6.3.1" data-path="lists-and-sequences.html"><a href="lists-and-sequences.html#lists-and-loops"><i class="fa fa-check"></i><b>6.3.1</b> Lists and Loops</a></li>
</ul></li>
<li class="chapter" data-level="6.4" data-path="lists-and-sequences.html"><a href="lists-and-sequences.html#nested-lists"><i class="fa fa-check"></i><b>6.4</b> Nested Lists</a></li>
<li class="chapter" data-level="6.5" data-path="lists-and-sequences.html"><a href="lists-and-sequences.html#tuples"><i class="fa fa-check"></i><b>6.5</b> Tuples</a></li>
</ul></li>
<li class="chapter" data-level="7" data-path="dictionaries.html"><a href="dictionaries.html"><i class="fa fa-check"></i><b>7</b> Dictionaries</a><ul>
<li class="chapter" data-level="7.1" data-path="dictionaries.html"><a href="dictionaries.html#resources-6"><i class="fa fa-check"></i><b>7.1</b> Resources</a></li>
<li class="chapter" data-level="7.2" data-path="dictionaries.html"><a href="dictionaries.html#dictionaries-1"><i class="fa fa-check"></i><b>7.2</b> Dictionaries</a><ul>
<li class="chapter" data-level="7.2.1" data-path="dictionaries.html"><a href="dictionaries.html#accessing-a-dictionary"><i class="fa fa-check"></i><b>7.2.1</b> Accessing a Dictionary</a></li>
</ul></li>
<li class="chapter" data-level="7.3" data-path="dictionaries.html"><a href="dictionaries.html#dictionary-methods"><i class="fa fa-check"></i><b>7.3</b> Dictionary Methods</a><ul>
<li class="chapter" data-level="7.3.1" data-path="dictionaries.html"><a href="dictionaries.html#dictionaries-and-loops"><i class="fa fa-check"></i><b>7.3.1</b> Dictionaries and Loops</a></li>
</ul></li>
<li class="chapter" data-level="7.4" data-path="dictionaries.html"><a href="dictionaries.html#nesting-dictionaries"><i class="fa fa-check"></i><b>7.4</b> Nesting Dictionaries</a></li>
<li class="chapter" data-level="7.5" data-path="dictionaries.html"><a href="dictionaries.html#which-data-structure-do-i-use"><i class="fa fa-check"></i><b>7.5</b> Which data structure do I use?</a></li>
</ul></li>
<li class="chapter" data-level="8" data-path="functional-iteration.html"><a href="functional-iteration.html"><i class="fa fa-check"></i><b>8</b> Functional Iteration</a><ul>
<li class="chapter" data-level="8.1" data-path="functional-iteration.html"><a href="functional-iteration.html#resources-7"><i class="fa fa-check"></i><b>8.1</b> Resources</a></li>
<li class="chapter" data-level="8.2" data-path="functional-iteration.html"><a href="functional-iteration.html#functions-are-variables"><i class="fa fa-check"></i><b>8.2</b> Functions ARE Variables</a><ul>
<li class="chapter" data-level="8.2.1" data-path="functional-iteration.html"><a href="functional-iteration.html#lambdas-anonymous-functions"><i class="fa fa-check"></i><b>8.2.1</b> lambdas: Anonymous Functions</a></li>
</ul></li>
<li class="chapter" data-level="8.3" data-path="functional-iteration.html"><a href="functional-iteration.html#functional-looping"><i class="fa fa-check"></i><b>8.3</b> Functional Looping</a><ul>
<li class="chapter" data-level="8.3.1" data-path="functional-iteration.html"><a href="functional-iteration.html#map"><i class="fa fa-check"></i><b>8.3.1</b> Map</a></li>
<li class="chapter" data-level="8.3.2" data-path="functional-iteration.html"><a href="functional-iteration.html#filter"><i class="fa fa-check"></i><b>8.3.2</b> Filter</a></li>
<li class="chapter" data-level="8.3.3" data-path="functional-iteration.html"><a href="functional-iteration.html#reduce"><i class="fa fa-check"></i><b>8.3.3</b> Reduce</a></li>
</ul></li>
<li class="chapter" data-level="8.4" data-path="functional-iteration.html"><a href="functional-iteration.html#list-comprehensions"><i class="fa fa-check"></i><b>8.4</b> List Comprehensions</a></li>
</ul></li>
<li class="chapter" data-level="9" data-path="pandas.html"><a href="pandas.html"><i class="fa fa-check"></i><b>9</b> Pandas</a><ul>
<li class="chapter" data-level="9.1" data-path="pandas.html"><a href="pandas.html#resources-8"><i class="fa fa-check"></i><b>9.1</b> Resources</a></li>
<li class="chapter" data-level="9.2" data-path="pandas.html"><a href="pandas.html#setup"><i class="fa fa-check"></i><b>9.2</b> Setup</a></li>
<li class="chapter" data-level="9.3" data-path="pandas.html"><a href="pandas.html#series"><i class="fa fa-check"></i><b>9.3</b> Series</a><ul>
<li class="chapter" data-level="9.3.1" data-path="pandas.html"><a href="pandas.html#series-operations-and-methods"><i class="fa fa-check"></i><b>9.3.1</b> Series Operations and Methods</a></li>
<li class="chapter" data-level="9.3.2" data-path="pandas.html"><a href="pandas.html#accessing-series"><i class="fa fa-check"></i><b>9.3.2</b> Accessing Series</a></li>
</ul></li>
<li class="chapter" data-level="9.4" data-path="pandas.html"><a href="pandas.html#data-frames"><i class="fa fa-check"></i><b>9.4</b> Data Frames</a><ul>
<li class="chapter" data-level="9.4.1" data-path="pandas.html"><a href="pandas.html#dataframe-operations-and-methods"><i class="fa fa-check"></i><b>9.4.1</b> DataFrame Operations and Methods</a></li>
<li class="chapter" data-level="9.4.2" data-path="pandas.html"><a href="pandas.html#accessing-dataframes"><i class="fa fa-check"></i><b>9.4.2</b> Accessing DataFrames</a></li>
</ul></li>
</ul></li>
<li class="divider"></li>
<li><a href="https://github.com/rstudio/bookdown" target="blank">Published with bookdown</a></li>
</ul>
</nav>
</div>
<div class="book-body">
<div class="body-inner">
<div class="book-header" role="navigation">
<h1>
<i class="fa fa-circle-o-notch fa-spin"></i><a href="./">Python Basics for Data Science</a>
</h1>
</div>
<div class="page-wrapper" tabindex="-1" role="main">
<div class="page-inner">
<section class="normal" id="section-">
<div id="software-installation" class="section level1">
<h1><span class="header-section-number">Chapter 1</span> Software Installation</h1>
<p>In this course, we’ll be using a variety of different software programs to write, manage, and execute the code that we write. Unfortunately, one of the most frustrating and confusing barriers to start working with code is simply getting your machine properly set-up, so set aside some time and dig in.</p>
<p>Note, classroom machines for this course should have all appropriate software already installed and ready to use.</p>
<div id="summary" class="section level2">
<h2><span class="header-section-number">1.1</span> Summary</h2>
<p>In short, you’ll need to install the following programs: see below for more information / options. While the rest of this book is about Python, we’ll also be using R and RStudo in this course:</p>
<ul>
<li><strong>Anaconda (Python)</strong>: A <em>python distribution</em> that also includes <em>notebook capabilities</em> through Jupyter notebooks (<a href="https://www.continuum.io/downloads">link</a>)</li>
<li><strong>R</strong>: A statistical programming language used to wrangle, analyze, and visualize data (<a href="https://cran.r-project.org/bin/macosx/">mac</a>, <a href="https://cran.r-project.org/bin/windows/base/">windows</a>)</li>
<li><strong>RStudio</strong>: An interface for writing and running R code, which is a primary language for the quarter (<a href="https://www.rstudio.com/products/rstudio/download3/">link</a>)</li>
<li><strong>Git</strong>: A set of command-line tools for tracking changes to a project. This is likely already installed on Macs. The Windows download will come with Git Bash, a simple interface for executing Git commands (<a href="https://git-scm.com/downloads">link</a>).</li>
<li><strong>Visual Studio Code</strong>: A text-editor in which to write longer programming scripts (<a href="https://code.visualstudio.com/download">link</a>).</li>
</ul>
<p>The following sections have additional information about the purpose of each component, how to install it, and alternative configurations.</p>
</div>
<div id="r" class="section level2">
<h2><span class="header-section-number">1.2</span> R</h2>
<p>R is a popular data science language used to download, analyze, and visualize data. You can download it at the appropriate link for your operating system (<a href="https://cran.r-project.org/bin/macosx/">mac</a>, <a href="https://cran.r-project.org/bin/windows/base/">windows</a>). At the link, click the appropriate download link and follow instructions:</p>
<div class="figure">
<img src="imgs/download_r.png" alt="r download link" />
<p class="caption">r download link</p>
</div>
</div>
<div id="rstudio" class="section level2">
<h2><span class="header-section-number">1.3</span> RStudio</h2>
<p>The primary programming language we will use throughout the course is R. It’s a very powerful statistical programming language that is built to work well with large and diverse datasets. While you are able to execute R scripts without an interface, the RStudio interface provides a wonderful way to engage with the R language. Importantly, you <strong>cannot use the RStudio interface until you have installed R.</strong></p>
<p>To download the RStudio program, select the installer for your operating system at this <a href="https://www.rstudio.com/products/rstudio/download3/">link</a>. Make sure to scroll down to download a <strong>free</strong> version of RStudio:</p>
<div class="figure">
<img src="imgs/r-studio-install.png" alt="r-studio installer screenshot" />
<p class="caption">r-studio installer screenshot</p>
</div>
<p>Once the download completes, double-click on the <code>.exe</code> file to run the installer. Simply follow the steps of the installer, and you should be prepared to use RStudio. By downloading RStudio, you will also install the R programming language, if it is not already present in your operating system.</p>
</div>
<div id="anaconda-python" class="section level2">
<h2><span class="header-section-number">1.4</span> Anaconda (Python)</h2>
<p>Python is a very popular all-purpose programming language that is making a major impact in the data-science arena. While Python may already be installed on your machine, it is common to download a <em>Python Distribution</em>, which also downloads a variety of commonly used packages.</p>
<p>The <strong>Anaconda</strong> distribution is popular because it also provides support for Jupyter notebooks (workbooks for documenting and sharing data science work). The internet is flooded with debates about <em>Python 2 v.s. Python 3</em>, but you should download <strong>Python 3</strong>. Python 3 is “the future”, but many libraries only provide Python 2 support. Download <a href="https://www.anaconda.com/download">here</a>.</p>
</div>
<div id="git" class="section level2">
<h2><span class="header-section-number">1.5</span> Git</h2>
<p>Git is a version control system that provides a set of commands that allow you to manage changes to a project (much more on this in <a href="https://github.com/info-201/m3-version-control">module-3</a>). For now, you’ll need to <a href="https://git-scm.com/downloads">download</a> and install the software. Note, if you are using a Windows machine, this will install a program called Git Bash, which provides a text-based interface for executing commands on your computer. For alternative/additional Windows command-line tools, see below.</p>
</div>
<div id="command-line-tools-windows" class="section level2">
<h2><span class="header-section-number">1.6</span> Command-line Tools (Windows)</h2>
<p>The command-line provides you a text-based interface for providing instructions to your computer. In this course, we’ll largely use the command-line for navigating our computer’s file structure, and executing commands that allow us to keep track of changes to the code we write (i.e., version control). If you’re using a Mac, you are able to access your command-line by default, and don’t need to install any additional software. If you’re using a Windows machine, you’ll need to install one of the following programs in order to interact directly with the command-line.</p>
<div id="git-bash" class="section level3">
<h3><span class="header-section-number">1.6.1</span> Git Bash</h3>
<p>Because we’ll primarily use the command line for implementing version control (i.e., keeping track of changes to our code), we can use a command-line tool that ships with the version control software, Git. When you download the <a href="https://git-scm.com/downloads">Git</a> software on Windows, the Git Bash user-interface will be installed. You can then navigate to Git Bash from your Desktop / Start Menu, and you will be able to use the appropriate syntax to keep track of code changes.</p>
</div>
<div id="windows-bash" class="section level3">
<h3><span class="header-section-number">1.6.2</span> Windows Bash</h3>
<p>With the release of Windows 10, Windows began providing command line (bash) support. If you already have Windows 10, here are a few <a href="http://www.howtogeek.com/249966/how-to-install-and-use-the-linux-bash-shell-on-windows-10/">instructions</a> for installing bash capabilities. This requires that you <a href="http://www.howtogeek.com/228042/how-to-switch-from-32-bit-windows-10-to-64-bit-windows-10/">switch to 64 bit windows</a>, and follow the instructions above. While this will provide you with direct bash capabilities, you may run into challenges along the way (I have not tested these instructions). Note, you will still <strong>need to install Git</strong> in addition to Windows Bash.</p>
</div>
<div id="powershell-windows-management-framework" class="section level3">
<h3><span class="header-section-number">1.6.3</span> Powershell (Windows Management Framework)</h3>
<p>If you want to explore more robust command-line alternatives for Windows, the Windows Management Framework (including a program called Powershell) seems to be a preferred standard. Powershell will provide a simple text-based interface for inputing commands. Note, you will still <strong>need to install Git</strong> in addition to Powershell.</p>
</div>
</div>
<div id="text-editors" class="section level2">
<h2><span class="header-section-number">1.7</span> Text Editors</h2>
<p>In order to write code, you need somewhere to write it (obviously). There are a variety of available programs that provide an interface for editing code. A major advantage of these programs is that they provide automatic formatting for easier interpretation of the code, along with cool features like auto-completion and integration with version control.</p>
<p>RStudio has a great built in text editor, but you’ll (at times) want to use another text editor which is more robust, or designed for a different programming language. You really only need to download one of the following programs, but feel free to download multiple text-editors to compare and contrast how you like them.</p>
<div id="visual-studio-code" class="section level3">
<h3><span class="header-section-number">1.7.1</span> Visual Studio Code</h3>
<p><a href="https://code.visualstudio.com/">Visual Studio Code</a> (or VS Code; not to be confused with Visual Studio) is a free, open-source editor developed by Microsoft—yes, really. It focuses on web programming and JavaScript, though also supports many other languages and provides a number of <a href="https://code.visualstudio.com/docs/editor/extension-gallery">community-built extensions</a> for adding even more features. Although fairly new, it is updated regularly and has has become one of our main editors for programming. VS Code is actually a stand-alone web application, so it’s written in the same HTML, CSS, and JavaScript you’ll learn in this course!</p>
<p>To install VS Code, follow the above link and Click the “Download” button to download the installer (e.g, <code>.exe</code>) file, then double-click on that to install the application.</p>
<p>Once you’ve installed VS Code, the trick to using it effectively is to get comfortable with the <a href="https://code.visualstudio.com/docs/getstarted/userinterface#_command-palette">Command Palette</a>. If you hit <code>Cmd+Shift+P</code>, VS Code will open a small window where you can search for whatever you want the editor to do. For example, if you type in <code>markdown</code> you can get list of commands related to Markdown files (including the ability to open up a preview). The <code>Format Code</code> option is particularly useful.</p>
<p>For more information about using VS Code, see <a href="https://code.visualstudio.com/docs">the documentation</a>, which includes <a href="https://code.visualstudio.com/docs/getstarted/introvideos">videos</a> if you find them useful.</p>
</div>
<div id="sublimetext" class="section level3">
<h3><span class="header-section-number">1.7.2</span> SublimeText</h3>
<p>SublimeText is a very popular text editor with excellent defaults and a variety of available extensions. One drawback is that, to use it without paying, you are using an unlimited free trial. Every ~10 times you save a file, it will ask you if you want to purchase the full version, which is a bit distracting. <a href="http://www.sublimetext.com/2">SublimeText2</a> is the current stable version of the software, though feel free to install <a href="http://www.sublimetext.com/3">SublimeText3</a> if you don’t mind using software that’s in beta.</p>
</div>
<div id="atom" class="section level3">
<h3><span class="header-section-number">1.7.3</span> Atom</h3>
<p>Atom is a text editor built by the folks at GitHub, and has been gaining in popularity. As an open source project, people are continually building (and making available) interesting/useful extensions. It’s built-in spell-check is a great feature, especially for documents that require lots of written text. See more and download <a href="https://atom.io/">here</a>.</p>
<p>If you run into any installation/configuration challenges, please let others know on the slack channel so that others can anticipate the same issues.</p>
</div>
</div>
<div id="resources" class="section level2">
<h2><span class="header-section-number">1.8</span> Resources</h2>
<ul>
<li><a href="https://www.rstudio.com/products/rstudio/download3/">RStudio</a></li>
<li>R <a href="https://cran.r-project.org/bin/macosx/">mac</a>, <a href="https://cran.r-project.org/bin/windows/base/">windows</a></li>
<li><a href="https://www.continuum.io/downloads">Anaconda (Python)</a></li>
<li><a href="http://www.sublimetext.com/2">SublimeText2</a></li>
<li><a href="https://atom.io/">Atom</a></li>
<li><a href="http://www.howtogeek.com/249966/how-to-install-and-use-the-linux-bash-shell-on-windows-10/">Installing Bash on Windows</a></li>
<li><a href="http://jupyter.org/">Jupyter Notebooks</a></li>
</ul>
</div>
</div>
</section>
</div>
</div>
</div>
<a href="index.html" class="navigation navigation-prev " aria-label="Previous page"><i class="fa fa-angle-left"></i></a>
<a href="functions.html" class="navigation navigation-next " aria-label="Next page""><i class="fa fa-angle-right"></i></a>
<script src="libs/gitbook-2.6.7/js/app.min.js"></script>
<script src="libs/gitbook-2.6.7/js/lunr.js"></script>
<script src="libs/gitbook-2.6.7/js/plugin-search.js"></script>
<script src="libs/gitbook-2.6.7/js/plugin-sharing.js"></script>
<script src="libs/gitbook-2.6.7/js/plugin-fontsettings.js"></script>
<script src="libs/gitbook-2.6.7/js/plugin-bookdown.js"></script>
<script src="libs/gitbook-2.6.7/js/jquery.highlight.js"></script>
<script>
require(["gitbook"], function(gitbook) {
gitbook.start({
"sharing": {
"github": false,
"facebook": true,
"twitter": true,
"google": false,
"weibo": false,
"instapper": false,
"vk": false,
"all": ["facebook", "google", "twitter", "weibo", "instapaper"]
},
"fontsettings": {
"theme": "white",
"family": "sans",
"size": 2
},
"edit": {
"link": "https://github.com/rstudio/bookdown-demo/edit/master/01-software-installation.Rmd",
"text": "Edit"
},
"download": ["bookdown-demo.pdf", "bookdown-demo.epub"],
"toc": {
"collapse": "section",
"scroll_highlight": true
}
});
});
</script>
</body>
</html>