Skip to content

Commit a1611cc

Browse files
committed
Autobuild
1 parent 994d878 commit a1611cc

18 files changed

Lines changed: 398 additions & 232 deletions

File tree

docs/exercises/answers/Exercise2_answers.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,7 @@ <h4 class="date"><a href="https://rockefelleruniversity.github.io/Intro_To_Pytho
497497
between the two?</li>
498498
</ul>
499499
<div class="sourceCode" id="cb10"><pre class="sourceCode python"><code class="sourceCode python"><span id="cb10-1"><a href="#cb10-1" tabindex="-1"></a>my_set1.intersection(my_set2) </span></code></pre></div>
500-
<pre><code>## {&#39;GSS&#39;, &#39;MCM10&#39;, &#39;PKM&#39;}</code></pre>
500+
<pre><code>## {&#39;PKM&#39;, &#39;GSS&#39;, &#39;MCM10&#39;}</code></pre>
501501
<p><strong>Exercise 3</strong> - <strong>NumPy</strong></p>
502502
<ul>
503503
<li>Import NumPy</li>

docs/exercises/exercises/Exercise2_exercise.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ <h4 class="date"><a href="https://rockefelleruniversity.github.io/Intro_To_Pytho
372372
<li>These are genes of interest from two experiments. What genes overlap
373373
between the two?</li>
374374
</ul>
375-
<pre><code>## {&#39;GSS&#39;, &#39;MCM10&#39;, &#39;PKM&#39;}</code></pre>
375+
<pre><code>## {&#39;PKM&#39;, &#39;GSS&#39;, &#39;MCM10&#39;}</code></pre>
376376
<p><strong>Exercise 3</strong> - <strong>NumPy</strong></p>
377377
<ul>
378378
<li><p>Import NumPy</p></li>

docs/presentations/r_code/Session2.R

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,14 @@ kable(minRepdf[,1:4], format='html')
7777
## os.listdir("data")
7878
##
7979

80+
##
81+
## os.chdir("/Users/mattpaul/Downloads/Intro_To_Python-master/r_course/")
82+
##
83+
84+
##
85+
## os.chdir("Downloads/Intro_To_Python-master/r_course/")
86+
##
87+
8088
## import numpy as np
8189
## my_table = np.genfromtxt("data/ToRead.csv", delimiter=",")
8290
##

docs/presentations/singlepage/Session1.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2284,7 +2284,7 @@ <h2>Sets can be modified</h2>
22842284
modification of sets.</p>
22852285
<div class="sourceCode" id="cb151"><pre class="sourceCode python"><code class="sourceCode python"><span id="cb151-1"><a href="#cb151-1" tabindex="-1"></a>myset.add(<span class="st">&quot;d&quot;</span>)</span>
22862286
<span id="cb151-2"><a href="#cb151-2" tabindex="-1"></a>myset</span></code></pre></div>
2287-
<pre><code>## {&#39;d&#39;, &#39;c&#39;, &#39;b&#39;, &#39;a&#39;}</code></pre>
2287+
<pre><code>## {&#39;c&#39;, &#39;b&#39;, &#39;d&#39;, &#39;a&#39;}</code></pre>
22882288
<div class="sourceCode" id="cb153"><pre class="sourceCode python"><code class="sourceCode python"><span id="cb153-1"><a href="#cb153-1" tabindex="-1"></a>myset.remove(<span class="st">&quot;d&quot;</span>)</span>
22892289
<span id="cb153-2"><a href="#cb153-2" tabindex="-1"></a>myset</span></code></pre></div>
22902290
<pre><code>## {&#39;c&#39;, &#39;b&#39;, &#39;a&#39;}</code></pre>

docs/presentations/singlepage/Session2.html

Lines changed: 119 additions & 83 deletions
Large diffs are not rendered by default.

docs/presentations/singlepage/Session3.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

docs/presentations/slides/Session1.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1263,7 +1263,7 @@
12631263
```
12641264

12651265
```
1266-
## {'d', 'c', 'b', 'a'}
1266+
## {'c', 'b', 'd', 'a'}
12671267
```
12681268

12691269

docs/presentations/slides/Session2.html

Lines changed: 66 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -88,51 +88,51 @@
8888
&lt;tbody&gt;
8989
&lt;tr&gt;
9090
&lt;td style="text-align:left;"&gt; Gene_a &lt;/td&gt;
91-
&lt;td style="text-align:right;"&gt; 4.468014 &lt;/td&gt;
92-
&lt;td style="text-align:right;"&gt; 3.437752 &lt;/td&gt;
93-
&lt;td style="text-align:right;"&gt; 5.149918 &lt;/td&gt;
91+
&lt;td style="text-align:right;"&gt; 3.376943 &lt;/td&gt;
92+
&lt;td style="text-align:right;"&gt; 1.403601 &lt;/td&gt;
93+
&lt;td style="text-align:right;"&gt; 4.453933 &lt;/td&gt;
9494
&lt;/tr&gt;
9595
&lt;tr&gt;
9696
&lt;td style="text-align:left;"&gt; Gene_b &lt;/td&gt;
97-
&lt;td style="text-align:right;"&gt; 4.103818 &lt;/td&gt;
98-
&lt;td style="text-align:right;"&gt; 4.317566 &lt;/td&gt;
99-
&lt;td style="text-align:right;"&gt; 4.571179 &lt;/td&gt;
97+
&lt;td style="text-align:right;"&gt; 3.954924 &lt;/td&gt;
98+
&lt;td style="text-align:right;"&gt; 3.111149 &lt;/td&gt;
99+
&lt;td style="text-align:right;"&gt; 4.236163 &lt;/td&gt;
100100
&lt;/tr&gt;
101101
&lt;tr&gt;
102102
&lt;td style="text-align:left;"&gt; Gene_c &lt;/td&gt;
103-
&lt;td style="text-align:right;"&gt; 4.392184 &lt;/td&gt;
104-
&lt;td style="text-align:right;"&gt; 2.411998 &lt;/td&gt;
105-
&lt;td style="text-align:right;"&gt; 3.463501 &lt;/td&gt;
103+
&lt;td style="text-align:right;"&gt; 2.474852 &lt;/td&gt;
104+
&lt;td style="text-align:right;"&gt; 6.118265 &lt;/td&gt;
105+
&lt;td style="text-align:right;"&gt; 3.487398 &lt;/td&gt;
106106
&lt;/tr&gt;
107107
&lt;tr&gt;
108108
&lt;td style="text-align:left;"&gt; Gene_d &lt;/td&gt;
109-
&lt;td style="text-align:right;"&gt; 3.797285 &lt;/td&gt;
110-
&lt;td style="text-align:right;"&gt; 4.327807 &lt;/td&gt;
111-
&lt;td style="text-align:right;"&gt; 4.619082 &lt;/td&gt;
109+
&lt;td style="text-align:right;"&gt; 3.789204 &lt;/td&gt;
110+
&lt;td style="text-align:right;"&gt; 5.881517 &lt;/td&gt;
111+
&lt;td style="text-align:right;"&gt; 3.576198 &lt;/td&gt;
112112
&lt;/tr&gt;
113113
&lt;tr&gt;
114114
&lt;td style="text-align:left;"&gt; Gene_e &lt;/td&gt;
115-
&lt;td style="text-align:right;"&gt; 9.950121 &lt;/td&gt;
116-
&lt;td style="text-align:right;"&gt; 11.295234 &lt;/td&gt;
117-
&lt;td style="text-align:right;"&gt; 10.778082 &lt;/td&gt;
115+
&lt;td style="text-align:right;"&gt; 9.677530 &lt;/td&gt;
116+
&lt;td style="text-align:right;"&gt; 10.508473 &lt;/td&gt;
117+
&lt;td style="text-align:right;"&gt; 10.675810 &lt;/td&gt;
118118
&lt;/tr&gt;
119119
&lt;tr&gt;
120120
&lt;td style="text-align:left;"&gt; Gene_f &lt;/td&gt;
121-
&lt;td style="text-align:right;"&gt; 10.667297 &lt;/td&gt;
122-
&lt;td style="text-align:right;"&gt; 10.017559 &lt;/td&gt;
123-
&lt;td style="text-align:right;"&gt; 10.614511 &lt;/td&gt;
121+
&lt;td style="text-align:right;"&gt; 8.859488 &lt;/td&gt;
122+
&lt;td style="text-align:right;"&gt; 10.016861 &lt;/td&gt;
123+
&lt;td style="text-align:right;"&gt; 9.449476 &lt;/td&gt;
124124
&lt;/tr&gt;
125125
&lt;tr&gt;
126126
&lt;td style="text-align:left;"&gt; Gene_g &lt;/td&gt;
127-
&lt;td style="text-align:right;"&gt; 11.082942 &lt;/td&gt;
128-
&lt;td style="text-align:right;"&gt; 10.251958 &lt;/td&gt;
129-
&lt;td style="text-align:right;"&gt; 9.772934 &lt;/td&gt;
127+
&lt;td style="text-align:right;"&gt; 8.579972 &lt;/td&gt;
128+
&lt;td style="text-align:right;"&gt; 9.582080 &lt;/td&gt;
129+
&lt;td style="text-align:right;"&gt; 10.846433 &lt;/td&gt;
130130
&lt;/tr&gt;
131131
&lt;tr&gt;
132132
&lt;td style="text-align:left;"&gt; Gene_h &lt;/td&gt;
133-
&lt;td style="text-align:right;"&gt; 9.603787 &lt;/td&gt;
134-
&lt;td style="text-align:right;"&gt; 9.202378 &lt;/td&gt;
135-
&lt;td style="text-align:right;"&gt; 9.507146 &lt;/td&gt;
133+
&lt;td style="text-align:right;"&gt; 9.727365 &lt;/td&gt;
134+
&lt;td style="text-align:right;"&gt; 8.816762 &lt;/td&gt;
135+
&lt;td style="text-align:right;"&gt; 8.779316 &lt;/td&gt;
136136
&lt;/tr&gt;
137137
&lt;/tbody&gt;
138138
&lt;/table&gt;
@@ -206,12 +206,51 @@
206206
```
207207

208208
---
209-
## Reading
209+
## Paths
210+
211+
When you give a path to python it can either be relative or absolute.
212+
213+
214+
![location](imgs/youarehere2.png)
215+
216+
---
217+
## Paths
218+
219+
To use our map analogy:
220+
221+
- Relative path are like directions i.e. take a left, go straight then take a right etc. The context of where you start is essential.
222+
223+
- Absolute paths are like an address. They give the final location in absence of any other external information.
224+
225+
Both have their benefits.
226+
227+
---
228+
229+
## Paths in use
230+
231+
The command we used before was using an absolute path. Typically they start with "/" to get to the top level of your computers file structure.
232+
233+
234+
``` python
235+
os.chdir("/Users/mattpaul/Downloads/Intro_To_Python-master/r_course/")
236+
```
237+
238+
Given that we started at: */Users/mattpaul*, we could have also used. This uses the knowledge that we are in that start position to find where we are going.
239+
240+
241+
``` python
242+
os.chdir("Downloads/Intro_To_Python-master/r_course/")
243+
```
244+
245+
---
246+
## Back to Reading
210247

211248
There are many ways to read in data. Most of the time we are importing simple 2D tables, so we want to generate a NumPy array using the `genfromtxt()` function.
212249

213250
Here we are reading a csv file (Comma-Separated Values). This means each value in our file is separated by a comma. So when we read the file we will specify that the delimiter is a comma.
214251

252+
We can use the relative path from our new working directory to find it.
253+
215254

216255

217256
``` python
@@ -509,7 +548,7 @@
509548

510549
So far we have been working interactively with the console: asking it questions and getting answers back immediately.
511550

512-
When you want to run all your code, or if you want to start working on automation you can run a whole script instead. In this case we have all our code written out in a *.py document.
551+
When you want to run all your code, or if you want to start working on automation you can run a whole script instead. In this case we have all our code written out in a *.py document. This is good practice for matured analysis that you have finalized to ensure that you have everything properly documented.
513552

514553
Lets have a look at an example python script.
515554

@@ -616,7 +655,7 @@
616655
---
617656
## An extra note
618657

619-
Keeping Your Code nice can be annoying. There exists many ways in which to store your code. Most of the time we are not writing scripts that are production level. Instead you will be doing an analysis of a data set and making decisions in an interactive manner.
658+
Keeping Your code nice can be annoying. There exists many ways in which to store your code. Most of the time we are not writing scripts that are production level. Instead you will be doing an analysis of a data set and making decisions in an interactive manner.
620659

621660
Notebooks give you a means to tie the code, the analysis decisions and the result of the code together into a single file.
622661

docs/presentations/slides/Session3.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -828,7 +828,7 @@
828828

829829

830830
```
831-
## &lt;matplotlib.colorbar.Colorbar object at 0x7fcb9bc3f610&gt;
831+
## &lt;matplotlib.colorbar.Colorbar object at 0x7f54f715c4f0&gt;
832832
```
833833

834834
![](Session3_files/figure-html/unnamed-chunk-38-27.png)&lt;!-- --&gt;

r_course/exercises/answers/Exercise2_answers.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,7 @@ <h4 class="date"><a href="https://rockefelleruniversity.github.io/Intro_To_Pytho
497497
between the two?</li>
498498
</ul>
499499
<div class="sourceCode" id="cb10"><pre class="sourceCode python"><code class="sourceCode python"><span id="cb10-1"><a href="#cb10-1" tabindex="-1"></a>my_set1.intersection(my_set2) </span></code></pre></div>
500-
<pre><code>## {&#39;GSS&#39;, &#39;MCM10&#39;, &#39;PKM&#39;}</code></pre>
500+
<pre><code>## {&#39;PKM&#39;, &#39;GSS&#39;, &#39;MCM10&#39;}</code></pre>
501501
<p><strong>Exercise 3</strong> - <strong>NumPy</strong></p>
502502
<ul>
503503
<li>Import NumPy</li>

0 commit comments

Comments
 (0)