-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathindex.html
389 lines (250 loc) · 17.3 KB
/
index.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
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
387
388
389
<!DOCTYPE html>
<html lang="en-us">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Monash Data Fluency | Python</title>
<meta name="HandheldFriendly" content="True">
<meta name="MobileOptimized" content="320">
<meta name="viewport" content="width=device-width,minimum-scale=1">
<meta name="generator" content="Hugo 0.40" />
<META NAME="ROBOTS" CONTENT="INDEX, FOLLOW">
<link href='https://MonashDataFluency.github.io/dist/main.css' rel='stylesheet' type="text/css" />
<link href='css/custom.css' rel='stylesheet' type="text/css" />
<link href="https://MonashDataFluency.github.io/intro_to_python/index.xml" rel="alternate" type="application/rss+xml" title="Monash Data Fluency" />
<link href="https://MonashDataFluency.github.io/intro_to_python/index.xml" rel="feed" type="application/rss+xml" title="Monash Data Fluency" />
<meta property="og:title" content="Python" />
<meta property="og:description" content="" />
<meta property="og:type" content="website" />
<meta property="og:url" content="https://MonashDataFluency.github.io/intro_to_python/" />
<meta property="og:updated_time" content="2018-02-23T13:28:03+11:00"/>
<meta itemprop="name" content="Python">
<meta itemprop="description" content="">
<meta name="twitter:card" content="summary"/>
<meta name="twitter:title" content="Python"/>
<meta name="twitter:description" content=""/>
</head>
<body class="ma0 avenir bg-near-white production">
<header class="cover bg-top" style="background-image: url('https://MonashDataFluency.github.io/images/banner.jpg');">
<div class="bg-black-60">
<div class="tc-l pv1 pv1-l ph3 ph4-ns">
<h1 class="f1 fw2 white-90 mb0 lh-title">
Python
</h1>
</div>
<nav class="pv3 ph3 ph4-ns" role="navigation">
<div class="flex-l justify-between items-center center">
<div class="f3 fw2 hover-white no-underline white-90 dib"></div>
<div class="flex-l items-center">
<ul class="pl0 mr3">
<li class="list f5 f4-ns fw4 dib pr3">
<a class="hover-white no-underline white-90" href="/" title="Home page">
Home
</a>
</li>
<li class="list f5 f4-ns fw4 dib pr3">
<a class="hover-white no-underline white-90" href="/about/" title="About page">
About
</a>
</li>
<li class="list f5 f4-ns fw4 dib pr3">
<a class="hover-white no-underline white-90" href="/contact/" title="Contact page">
Contact
</a>
</li>
<li class="list f5 f4-ns fw4 dib pr3">
<a class="hover-white no-underline white-90" href="/events/" title="Events page">
Events
</a>
</li>
<li class="list f5 f4-ns fw4 dib pr3">
<a class="hover-white no-underline white-90" href="/resources/" title="Resources page">
Resources
</a>
</li>
</ul>
<a href="https://twitter.com/ResDatFlu" class="link-transition twitter link dib z-999 pt3 pt0-l mr2" title="Twitter link">
<svg height="32px" style="enable-background:new 0 0 67 67;" version="1.1" viewBox="0 0 67 67" width="32px" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M37.167,22.283c-2.619,0.953-4.274,3.411-4.086,6.101 l0.063,1.038l-1.048-0.127c-3.813-0.487-7.145-2.139-9.974-4.915l-1.383-1.377l-0.356,1.017c-0.754,2.267-0.272,4.661,1.299,6.271 c0.838,0.89,0.649,1.017-0.796,0.487c-0.503-0.169-0.943-0.296-0.985-0.233c-0.146,0.149,0.356,2.076,0.754,2.839 c0.545,1.06,1.655,2.097,2.871,2.712l1.027,0.487l-1.215,0.021c-1.173,0-1.215,0.021-1.089,0.467 c0.419,1.377,2.074,2.839,3.918,3.475l1.299,0.444l-1.131,0.678c-1.676,0.976-3.646,1.526-5.616,1.568 C19.775,43.256,19,43.341,19,43.405c0,0.211,2.557,1.397,4.044,1.864c4.463,1.377,9.765,0.783,13.746-1.568 c2.829-1.673,5.657-5,6.978-8.221c0.713-1.716,1.425-4.851,1.425-6.354c0-0.975,0.063-1.102,1.236-2.267 c0.692-0.678,1.341-1.419,1.467-1.631c0.21-0.403,0.188-0.403-0.88-0.043c-1.781,0.636-2.033,0.551-1.152-0.402 c0.649-0.678,1.425-1.907,1.425-2.267c0-0.063-0.314,0.042-0.671,0.233c-0.377,0.212-1.215,0.53-1.844,0.72l-1.131,0.361l-1.027-0.7 c-0.566-0.381-1.361-0.805-1.781-0.932C39.766,21.902,38.131,21.944,37.167,22.283z M33,64C16.432,64,3,50.569,3,34S16.432,4,33,4 s30,13.431,30,30S49.568,64,33,64z" style="fill-rule:evenodd;clip-rule:evenodd;fill:;"/></svg>
</a>
<a href="https://github.com/MonashDataFluency" class="link-transition github link dib z-999 pt3 pt0-l mr2" title="Github link">
<svg height="32px" style="enable-background:new 0 0 512 512;" version="1.1" viewBox="0 0 512 512" width="32px" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" >
<path d="M256,32C132.3,32,32,134.8,32,261.7c0,101.5,64.2,187.5,153.2,217.9c11.2,2.1,15.3-5,15.3-11.1 c0-5.5-0.2-19.9-0.3-39.1c-62.3,13.9-75.5-30.8-75.5-30.8c-10.2-26.5-24.9-33.6-24.9-33.6c-20.3-14.3,1.5-14,1.5-14 c22.5,1.6,34.3,23.7,34.3,23.7c20,35.1,52.4,25,65.2,19.1c2-14.8,7.8-25,14.2-30.7c-49.7-5.8-102-25.5-102-113.5 c0-25.1,8.7-45.6,23-61.6c-2.3-5.8-10-29.2,2.2-60.8c0,0,18.8-6.2,61.6,23.5c17.9-5.1,37-7.6,56.1-7.7c19,0.1,38.2,2.6,56.1,7.7 c42.8-29.7,61.5-23.5,61.5-23.5c12.2,31.6,4.5,55,2.2,60.8c14.3,16.1,23,36.6,23,61.6c0,88.2-52.4,107.6-102.3,113.3 c8,7.1,15.2,21.1,15.2,42.5c0,30.7-0.3,55.5-0.3,63c0,6.1,4,13.3,15.4,11C415.9,449.1,480,363.1,480,261.7 C480,134.8,379.7,32,256,32z"/>
</svg>
</a>
</div>
</div>
</nav>
</div>
</header>
<main class="pb7" role="main">
<article class="cf pa3 pa4-m pa4-l">
<div class="measure-wide-l center f4 lh-copy nested-copy-line-height nested-links nested-img mid-gray">
<h2 id="introduction-to-python-workshop">Introduction to Python Workshop</h2>
<ul>
<li><strong>Date</strong> : 23rd March 2018</li>
<li><strong>Time</strong> : 1:00pm to 5:00pm</li>
<li><strong>Location</strong> : T1, Sir Louis Matheson Library, Clayton, VIC</li>
<li><strong>Instructors</strong> : Anup Shah, Kirill Tsyganov</li>
<li><strong>Helpers</strong> : Simon Michnowicz, Michael See<br /></li>
</ul>
<p>This hands-on workshop aims to equip participants with the fundamentals of programming and give them skills needed to apply data analysis approaches to their research questions.</p>
<h4 id="general-information">General Information</h4>
<p>The workshop will be taught in a similar style to Data Carpentry workshops. <a href="http://www.datacarpentry.org/">Data Carpentry’s</a> mission is to trains researchers in the core data skills for efficient, shareable, and reproducible research practices.</p>
<p><strong>Who:</strong> The course is aimed at beginners to programming. You don’t need to have any previous knowledge of the tools that will be presented at the workshop.</p>
<p><strong>Setup Requirements</strong>: BYO Laptop. No software installation required. The course will be taught online, so active internet connection is required. Tools and material will be provided on the day.</p>
<h4 id="schedule">Schedule</h4>
<table>
<thead>
<tr>
<th>Time</th>
<th align="right">Programme</th>
</tr>
</thead>
<tbody>
<tr>
<td>13:00</td>
<td align="right">Welcome</td>
</tr>
<tr>
<td>13:15</td>
<td align="right">Session 1</td>
</tr>
<tr>
<td>15:15</td>
<td align="right">Break</td>
</tr>
<tr>
<td>15:30</td>
<td align="right">Session 2</td>
</tr>
<tr>
<td>16:45</td>
<td align="right">Wrap-up</td>
</tr>
</tbody>
</table>
<h4 id="login-information">Login Information</h4>
<ul>
<li><a href="http://130.220.208.123:9393/">Login to Server</a> using details send out on your registered email.</li>
</ul>
<h4 id="shared-notepad">Shared Notepad</h4>
<ul>
<li><a href="http://biotraining.erc.monash.edu:9001/p/intro_to_python_march_23_18">Click here</a> to go to shared notepad.</li>
</ul>
<h4 id="syllabus">Syllabus</h4>
<ul>
<li><a href="/intro_to_python/intro/">Introduction to Python</a></li>
<li><a href="/intro_to_python/working_with_data/">Data analysis in Python</a></li>
<li><a href="/intro_to_python/indexing/">Indexing and Slicing</a></li>
<li><a href="/intro_to_python/loops/">Automation</a></li>
<li><a href="/intro_to_python/plotting/">Plotting with Python</a></li>
<li><a href="http://www.datacarpentry.org/python-ecology-lesson/reference/">References</a>
<br /></li>
</ul>
</div>
</article>
<div class="mw8 center">
<section class="flex-ns flex-wrap justify-around mt5">
<div class="relative w-100 mb4 bg-white">
<div class="relative w-100 mb4 bg-white nested-copy-line-height">
<div class="bg-white mb3 pa4 gray overflow-hidden">
<span class="f6 db">Intro to python</span>
<h1 class="f3 near-black">
<a href="/intro_to_python/intro/" class="link black dim">
01 Programming in Python (Introduction)
</a>
</h1>
<div class="nested-links f5 lh-copy nested-copy-line-height">
The Basics of Python Python is a general purpose programming language that supports rapid development of scripts and applications.
Python’s main advantages:
Open Source software, supported by Python Software Foundation Available on all platforms (ie. Windows, Linux and MacOS) It is a general-purpose programming language Supports multiple programming paradigms Very large community with a rich ecosystem of third-party packages Interpreter Python is an interpreted language which can be used in two ways:
</div>
</div>
</div>
</div>
<div class="relative w-100 mb4 bg-white">
<div class="relative w-100 mb4 bg-white nested-copy-line-height">
<div class="bg-white mb3 pa4 gray overflow-hidden">
<span class="f6 db">Intro to python</span>
<h1 class="f3 near-black">
<a href="/intro_to_python/working_with_data/" class="link black dim">
02 Data Analysis in Python
</a>
</h1>
<div class="nested-links f5 lh-copy nested-copy-line-height">
Working With Pandas DataFrames We can automate the process of performing data manipulations in Python. It’s efficient to spend time building the code to perform these tasks because once it’s built, we can use it over and over on different datasets that use a similar format. This makes our methods easily reproducible. We can also easily share our code with colleagues and they can replicate the same analysis.
The Dataset For this lesson, we will be using the Portal Teaching data, a subset of the data from Ernst et al Long-term monitoring and experimental manipulation of a Chihuahuan Desert ecosystem near Portal, Arizona, USA
</div>
</div>
</div>
</div>
<div class="relative w-100 mb4 bg-white">
<div class="relative w-100 mb4 bg-white nested-copy-line-height">
<div class="bg-white mb3 pa4 gray overflow-hidden">
<span class="f6 db">Intro to python</span>
<h1 class="f3 near-black">
<a href="/intro_to_python/indexing/" class="link black dim">
03 Indexing, Slicing and Subsetting
</a>
</h1>
<div class="nested-links f5 lh-copy nested-copy-line-height">
In lesson 02, we read a CSV into a Python pandas DataFrame. We learned:
How to save the DataFrame to a named object, How to perform basic math on the data, How to calculate summary statistics, and How to create basic plots of the data. In this lesson, we will explore ways to access different parts of the data using:
Indexing, Slicing, and Subsetting Loading our data We will continue to use the surveys dataset that we worked with in the last lesson.
</div>
</div>
</div>
</div>
<div class="relative w-100 mb4 bg-white">
<div class="relative w-100 mb4 bg-white nested-copy-line-height">
<div class="bg-white mb3 pa4 gray overflow-hidden">
<span class="f6 db">Intro to python</span>
<h1 class="f3 near-black">
<a href="/intro_to_python/loops/" class="link black dim">
04 Automation with Loops
</a>
</h1>
<div class="nested-links f5 lh-copy nested-copy-line-height">
An example task that we might want to repeat is printing each character in a word on a line of its own.
word = 'lead' We can access a character in a string using its index. For example, we can get the first character of the word 'lead', by using word[0]. One way to print each character is to use four print statements:
print(word[0]) print(word[1]) print(word[2]) print(word[3]) Gives output
</div>
</div>
</div>
</div>
<div class="relative w-100 mb4 bg-white">
<div class="relative w-100 mb4 bg-white nested-copy-line-height">
<div class="bg-white mb3 pa4 gray overflow-hidden">
<span class="f6 db">Intro to python</span>
<h1 class="f3 near-black">
<a href="/intro_to_python/plotting/" class="link black dim">
05 Making Plots With ggplot
</a>
</h1>
<div class="nested-links f5 lh-copy nested-copy-line-height">
Introduction Python has powerful built-in plotting capabilities such as matplotlib, but with great power comes great complexity. For this exercise, we are going to use different python library, plotnine. There are a number of different libraries to choose from, but we are setting on plotnine as this is python port of original ggplot2 an R library (package), which is a very nice way to create publication quality plots and syntax is preserved, meaning you can take your python ggplot code and run it in R if you want it.
</div>
</div>
</div>
</div>
</section>
</div>
</main>
<footer class="bg-near-black bottom-0 w-100 pa3" role="contentinfo">
<div class="flex justify-between">
<a class="f4 fw4 hover-white no-underline white-70 dn dib-ns pv2 ph3" href="https://MonashDataFluency.github.io/" >
© 2018 Monash Data Fluency
</a>
<a href="https://twitter.com/ResDatFlu" class="link-transition twitter link dib z-999 pt3 pt0-l mr2" title="Twitter link">
<svg height="32px" style="enable-background:new 0 0 67 67;" version="1.1" viewBox="0 0 67 67" width="32px" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M37.167,22.283c-2.619,0.953-4.274,3.411-4.086,6.101 l0.063,1.038l-1.048-0.127c-3.813-0.487-7.145-2.139-9.974-4.915l-1.383-1.377l-0.356,1.017c-0.754,2.267-0.272,4.661,1.299,6.271 c0.838,0.89,0.649,1.017-0.796,0.487c-0.503-0.169-0.943-0.296-0.985-0.233c-0.146,0.149,0.356,2.076,0.754,2.839 c0.545,1.06,1.655,2.097,2.871,2.712l1.027,0.487l-1.215,0.021c-1.173,0-1.215,0.021-1.089,0.467 c0.419,1.377,2.074,2.839,3.918,3.475l1.299,0.444l-1.131,0.678c-1.676,0.976-3.646,1.526-5.616,1.568 C19.775,43.256,19,43.341,19,43.405c0,0.211,2.557,1.397,4.044,1.864c4.463,1.377,9.765,0.783,13.746-1.568 c2.829-1.673,5.657-5,6.978-8.221c0.713-1.716,1.425-4.851,1.425-6.354c0-0.975,0.063-1.102,1.236-2.267 c0.692-0.678,1.341-1.419,1.467-1.631c0.21-0.403,0.188-0.403-0.88-0.043c-1.781,0.636-2.033,0.551-1.152-0.402 c0.649-0.678,1.425-1.907,1.425-2.267c0-0.063-0.314,0.042-0.671,0.233c-0.377,0.212-1.215,0.53-1.844,0.72l-1.131,0.361l-1.027-0.7 c-0.566-0.381-1.361-0.805-1.781-0.932C39.766,21.902,38.131,21.944,37.167,22.283z M33,64C16.432,64,3,50.569,3,34S16.432,4,33,4 s30,13.431,30,30S49.568,64,33,64z" style="fill-rule:evenodd;clip-rule:evenodd;fill:;"/></svg>
</a>
<a href="https://github.com/MonashDataFluency" class="link-transition github link dib z-999 pt3 pt0-l mr2" title="Github link">
<svg height="32px" style="enable-background:new 0 0 512 512;" version="1.1" viewBox="0 0 512 512" width="32px" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" >
<path d="M256,32C132.3,32,32,134.8,32,261.7c0,101.5,64.2,187.5,153.2,217.9c11.2,2.1,15.3-5,15.3-11.1 c0-5.5-0.2-19.9-0.3-39.1c-62.3,13.9-75.5-30.8-75.5-30.8c-10.2-26.5-24.9-33.6-24.9-33.6c-20.3-14.3,1.5-14,1.5-14 c22.5,1.6,34.3,23.7,34.3,23.7c20,35.1,52.4,25,65.2,19.1c2-14.8,7.8-25,14.2-30.7c-49.7-5.8-102-25.5-102-113.5 c0-25.1,8.7-45.6,23-61.6c-2.3-5.8-10-29.2,2.2-60.8c0,0,18.8-6.2,61.6,23.5c17.9-5.1,37-7.6,56.1-7.7c19,0.1,38.2,2.6,56.1,7.7 c42.8-29.7,61.5-23.5,61.5-23.5c12.2,31.6,4.5,55,2.2,60.8c14.3,16.1,23,36.6,23,61.6c0,88.2-52.4,107.6-102.3,113.3 c8,7.1,15.2,21.1,15.2,42.5c0,30.7-0.3,55.5-0.3,63c0,6.1,4,13.3,15.4,11C415.9,449.1,480,363.1,480,261.7 C480,134.8,379.7,32,256,32z"/>
</svg>
</a>
</div>
</footer>
<script src="https://MonashDataFluency.github.io/dist/app.bundle.js" async></script>
</body>
</html>