Skip to content

Commit c8b89a0

Browse files
committed
push website: david edits to module 1 and module 2
1 parent e9626e5 commit c8b89a0

File tree

88 files changed

+1056
-604
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

88 files changed

+1056
-604
lines changed
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

docs/.doctrees/environment.pickle

949 Bytes
Binary file not shown.

docs/Module1_GettingStartedWithPython/GettingStartedWithPython.html

+11-11
Original file line numberDiff line numberDiff line change
@@ -430,14 +430,14 @@ <h2>What is Python?<a class="headerlink" href="#What-is-Python?" title="Permalin
430430
<h2>Python Scripts<a class="headerlink" href="#Python-Scripts" title="Permalink to this headline"></a></h2>
431431
<p>You can save the the valid code from the preceding section in a text
432432
file using a simple text editor, and <em>voilà</em> you have written a <strong>Python
433-
script</strong>: a text file whose contents is Python code. It is standard to
434-
save this text file using the suffix <code class="docutils literal"><span class="pre">.py</span></code> (e.g. <code class="docutils literal"><span class="pre">my_code.py</span></code>),
435-
rather than the familiar <code class="docutils literal"><span class="pre">.txt</span></code> (e.g. <code class="docutils literal"><span class="pre">my_text.txt</span></code>). There is
436-
nothing special about the <code class="docutils literal"><span class="pre">.py</span></code> suffix other than it helps to
437-
differentiate files that contain Python code from run-of-the-mill text
438-
files, which contain plain English.</p>
433+
script</strong>: a text file containing Python code. It is standard to save
434+
this text file using the suffix <code class="docutils literal"><span class="pre">.py</span></code> (e.g. <code class="docutils literal"><span class="pre">my_code.py</span></code>), rather
435+
than the familiar <code class="docutils literal"><span class="pre">.txt</span></code> (e.g. <code class="docutils literal"><span class="pre">my_text.txt</span></code>). There is nothing
436+
special about the <code class="docutils literal"><span class="pre">.py</span></code> suffix; it simply helps differentiate files
437+
that contain Python code from run-of-the-mill text files, which contain
438+
plain English.</p>
439439
<p>Although you can use simple text editors to write Python scripts
440-
(e.g.&nbsp;notepad (Win), TextEdit (Mac), vim (Linux)), there are much more
440+
(e.g.&nbsp;notepad (Win), TextEdit (Mac), nano (Linux)), there are much more
441441
sophisticated editors that provide an “integrated development
442442
environment” (IDE) for writing code. An IDE, configured to support
443443
Python, will warn you if you have written code that violates Python’s
@@ -486,7 +486,7 @@ <h2>What is a Python Interpreter and What Does it Mean to “Install Python”?<
486486
<div class="admonition warning">
487487
<p class="first fa fa-exclamation-circle"><strong>About Installing Python</strong>:</p>
488488
<p class="last">Do not download and install Python from python.org. There isn’t anything
489-
wrong with this, however a later section will provide you with explicit
489+
wrong with this, but a later section will provide you with explicit
490490
instructions for installing Python on your machine.</p>
491491
</div>
492492
<p>If you “install Python on your computer” from
@@ -522,7 +522,7 @@ <h2>What is a Python Interpreter and What Does it Mean to “Install Python”?<
522522
<p>It may be confusing to think that the Python language is interpreted by
523523
using a program written in another language. How, then, is that language
524524
interpreted? The answer, in the case of CPython, is that C code need not
525-
be interpreted; programs exist for Windows, Macs, and Linux that can
525+
be interpreted; programs exist for Windows, Mac, and Linux that can
526526
translate C code directly into machine instructions.</p>
527527
</div>
528528
<div class="section" id="Why-Python?">
@@ -531,7 +531,7 @@ <h2>Why Python?<a class="headerlink" href="#Why-Python?" title="Permalink to thi
531531
likely the <a class="reference external" href="https://cacm.acm.org/blogs/blog-cacm/176450-python-is-now-the-most-popular-introductory-teaching-language-at-top-u-s-universities/fulltext">most popular introductory language at
532532
universities</a>.
533533
First and foremost, its syntax is designed to be intuitive and readable.
534-
For example, following Python code:</p>
534+
For example, the following Python code:</p>
535535
<div class="highlight-python"><div class="highlight"><pre><span></span><span class="k">print</span><span class="p">(</span><span class="s2">&quot;Hello world&quot;</span><span class="p">)</span>
536536
</pre></div>
537537
</div>
@@ -540,7 +540,7 @@ <h2>Why Python?<a class="headerlink" href="#Why-Python?" title="Permalink to thi
540540

541541
<span class="kt">int</span> <span class="nf">main</span><span class="p">()</span>
542542
<span class="p">{</span>
543-
<span class="n">std</span><span class="o">::</span><span class="n">cout</span> <span class="o">&lt;&lt;</span> <span class="s">&quot;Hello world&quot;</span><span class="p">;</span>
543+
<span class="n">std</span><span class="o">::</span><span class="n">cout</span> <span class="o">&lt;&lt;</span> <span class="s">&quot;Hello world&quot;</span> <span class="o">&lt;&lt;</span> <span class="n">std</span><span class="o">::</span><span class="n">endl</span><span class="p">;</span>
544544
<span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
545545
<span class="p">}</span>
546546
</pre></div>

docs/Module1_GettingStartedWithPython/Getting_Started_With_IDEs_and_Notebooks.html

+5-5
Original file line numberDiff line numberDiff line change
@@ -223,9 +223,9 @@ <h2>What You Will Learn<a class="headerlink" href="#What-You-Will-Learn" title="
223223
it directly in your computer’s terminal.</li>
224224
<li>The IPython shell is a much nicer version of the Python shell - it
225225
provides syntax highlighting, autocompletion, and other features.</li>
226-
<li>Jupyter notebook is a powerful tool for prototyping and experimenting
227-
with code, as well as visualizing data and writing nicely-formatted
228-
text. We will be using this throughout the course.</li>
226+
<li>The Jupyter Notebook is a powerful tool for prototyping and
227+
experimenting with code, as well as visualizing data and writing
228+
nicely-formatted text. We will be using this throughout the course.</li>
229229
</ul>
230230
</div>
231231
<div class="section" id="Integrated-Development-Environments">
@@ -237,7 +237,7 @@ <h2>Integrated Development Environments<a class="headerlink" href="#Integrated-D
237237
a simple text editor to write Python code (and it is a big mistake use
238238
word-processing software, like Microsoft Word, to do so). Instead we
239239
want an “integrated development environment” (IDE) that will facilitate
240-
our code writing.</p>
240+
our code-writing.</p>
241241
<p>First and foremost, a good IDE will provide a text editor that will:</p>
242242
<ul class="simple">
243243
<li>check your code for syntax errors (a misspelled function name, a
@@ -282,7 +282,7 @@ <h3>Recommended IDEs<a class="headerlink" href="#Recommended-IDEs" title="Permal
282282
<li>works with many different languages, so you only need to familiarize
283283
yourself with one IDE</li>
284284
<li>a huge number of extensions can be downloaded to add functionality to
285-
the editor, these are created by a large community of open-source
285+
the editor; these are created by a large community of open-source
286286
developers.</li>
287287
</ul>
288288
<p><strong>Cons</strong></p>

docs/Module1_GettingStartedWithPython/Informal_Intro_Python.html

+5-5
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ <h1>An Informal Introduction to Python<a class="headerlink" href="#An-Informal-I
397397
doing so, we will learn about the Python standard library, and how to
398398
make use of its modules, like the math module. IPython’s autocompletion
399399
and documentation-display utilities will provide a nice means for
400-
exploring the library and the functionality built-in to the different
400+
exploring the library and the functionality built into the different
401401
types of Python objects. A quick glimpse at Python’s strings and lists
402402
will hint at the common interface Python provides for working with
403403
sequences of objects, while highlighting some of the nice features of
@@ -681,7 +681,7 @@ <h2>Messing with Strings<a class="headerlink" href="#Messing-with-Strings" title
681681
</div>
682682
<p>Of course, strings are useful beyond merely containing text! Let’s
683683
explore some ways to manipulate strings. First, we’ll write a string and
684-
assign a variable named <code class="docutils literal"><span class="pre">sentence</span></code> to it:</p>
684+
assign it to a variable named <code class="docutils literal"><span class="pre">sentence</span></code>:</p>
685685
<div class="nbinput nblast docutils container">
686686
<div class="prompt highlight-none"><div class="highlight"><pre>
687687
<span></span>In [13]:
@@ -860,7 +860,7 @@ <h2>Messing with Strings<a class="headerlink" href="#Messing-with-Strings" title
860860
</div>
861861
<div class="section" id="Playing-with-Lists">
862862
<h2>Playing with Lists<a class="headerlink" href="#Playing-with-Lists" title="Permalink to this headline"></a></h2>
863-
<p>A list is one of several types of containers that are built-in to
863+
<p>A list is one of several types of containers that are built into
864864
Python’s standard library. It can hold a sequence of Python objects. We
865865
can create a list of numbers:</p>
866866
<div class="nbinput docutils container">
@@ -980,8 +980,8 @@ <h2>Playing with Lists<a class="headerlink" href="#Playing-with-Lists" title="Pe
980980
</pre></div>
981981
</div>
982982
</div>
983-
<p>Negative integers can be used index relative to the end (right-side) of
984-
the list.</p>
983+
<p>Negative integers can be used to index relative to the end (right-side)
984+
of the list.</p>
985985
<div class="nbinput docutils container">
986986
<div class="prompt highlight-none"><div class="highlight"><pre>
987987
<span></span>In [13]:

docs/Module1_GettingStartedWithPython/Installing_Python.html

+3-3
Original file line numberDiff line numberDiff line change
@@ -214,13 +214,13 @@ <h1>Installing Python<a class="headerlink" href="#Installing-Python" title="Perm
214214
and other useful Python libraries on your machine via the Anaconda
215215
platform. Installing the Anaconda platform will install the following:</p>
216216
<ul class="simple">
217-
<li>Python, specifically the CPython interpreter that we discussed in the
217+
<li>Python; specifically the CPython interpreter that we discussed in the
218218
previous section.</li>
219219
<li>A number of useful Python packages, like matplotlib, NumPy, and
220220
SciPy.</li>
221221
<li>Jupyter, which provides an interactive “notebook” environment for
222222
prototyping code.</li>
223-
<li>conda, a package manager that will allow you to install and update
223+
<li>conda: a package manager that will allow you to install and update
224224
Python and additional Python packages, while handling all
225225
compatibility issues for you.</li>
226226
</ul>
@@ -238,7 +238,7 @@ <h1>Installing Python<a class="headerlink" href="#Installing-Python" title="Perm
238238
<div class="admonition note">
239239
<p class="first fa fa-exclamation-circle"><strong>Takeaway</strong>:</p>
240240
<p class="last">“Anaconda” is a collection of the CPython interpreter and a number of
241-
very popular Python libraries for doing data science related work. It
241+
very popular Python libraries for doing data science-related work. It
242242
also provides a package manager for downloading/updating Python
243243
packages, and an environment manager for maintaining independent
244244
installations of Python side-by-side.</p>

docs/Module1_GettingStartedWithPython/Jupyter_Notebooks.html

+16-16
Original file line numberDiff line numberDiff line change
@@ -380,22 +380,22 @@
380380
</style>
381381
<div class="section" id="Jupyter-Notebooks">
382382
<h1>Jupyter Notebooks<a class="headerlink" href="#Jupyter-Notebooks" title="Permalink to this headline"></a></h1>
383-
<p>In recent years, the Jupyter notebook has become as a massively popular
383+
<p>In recent years, the Jupyter Notebook has become a massively popular
384384
tool for doing research-oriented work in Python and other languages
385385
alike. Its emergence marked a paradigm shift in the way data science is
386386
conducted.</p>
387387
<p>A Jupyter notebook is similar to the IPython console, but, instead of
388-
only being able to only work with a single line of code at a time, you
389-
can easily and edit and re-execute <em>any</em> code that had been written in a
388+
only being able to work with a single line of code at a time, you can
389+
easily edit and re-execute <em>any</em> code that had been written in a
390390
notebook. Furthermore, you can save a notebook, and thus return to it
391391
later. Additionally, a notebook provides many terrific features. For
392392
instance, you can embed visualizations of data within a notebook, and
393393
write blocks of nicely-formatted text (using the <a class="reference external" href="https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet">Markdown
394394
syntax</a>),
395395
for presenting and explaining the contents of the notebook.</p>
396-
<p>In this way, a Jupyter notebook is stands out as an excellent tool for
397-
many practical applications in. You could work on a notebook while you
398-
are working through sections of this website, for instance, testing out
396+
<p>In this way, the Jupyter Notebook stands out as an excellent tool for
397+
many practical applications. You could work on a notebook while you are
398+
working through sections of this website, for instance, testing out
399399
snippets of code, and answering reading-comprehension questions as you
400400
proceed through the text, and using markdown-headers to visually
401401
separate different portions of the notebook. When I do research, I am
@@ -458,14 +458,14 @@ <h2>Notebook Cells<a class="headerlink" href="#Notebook-Cells" title="Permalink
458458
<span class="n">y</span> <span class="o">=</span> <span class="mi">4</span>
459459
</pre></div>
460460
</div>
461-
<p>then press <code class="docutils literal"><span class="pre">&lt;SHIFT&gt;+&lt;RETURN&gt;</span></code>. This will execute all of the code
462-
within the given cell (in this instance, assigning the variables <code class="docutils literal"><span class="pre">x</span></code>
463-
and <code class="docutils literal"><span class="pre">y</span></code> with the values 3 and 4, respectively) and then creates a new
464-
cell below. In the next cell type the code:</p>
461+
<p>then press <code class="docutils literal"><span class="pre">&lt;SHIFT&gt;+&lt;ENTER&gt;</span></code>. This will execute all of the code within
462+
the given cell (in this instance, assigning the variables <code class="docutils literal"><span class="pre">x</span></code> and
463+
<code class="docutils literal"><span class="pre">y</span></code> with the values 3 and 4, respectively) and then creates a new cell
464+
below. In the next cell type the code:</p>
465465
<div class="highlight-python"><div class="highlight"><pre><span></span><span class="n">x</span> <span class="o">+</span> <span class="n">y</span>
466466
</pre></div>
467467
</div>
468-
<p>and hit <code class="docutils literal"><span class="pre">&lt;SHIFT&gt;+&lt;RETURN&gt;</span></code> to execute this code. The number 7 will
468+
<p>and hit <code class="docutils literal"><span class="pre">&lt;SHIFT&gt;+&lt;ENTER&gt;</span></code> to execute this code. The number 7 will
469469
appear beneath the cell - this, of course, is the value that is returned
470470
when <code class="docutils literal"><span class="pre">3</span> <span class="pre">+</span> <span class="pre">4</span></code> is evaluated:</p>
471471
<div class="figure" id="id3">
@@ -1361,9 +1361,9 @@ <h2>Familiarizing Yourself with Jupyter Notebooks<a class="headerlink" href="#Fa
13611361
<p><strong>Command Mode (Press ``&lt;ESC&gt;`` to activate)</strong></p>
13621362
<p>When in command mode, you can use keyboard shortcuts to
13631363
create/delete/cut/paste notebook cells, and to change a cell’s type
1364-
between code and markdown mode. Your selected cell will be surrounded by
1365-
a <em>blue</em> border when you are in command mode. For a complete listing of
1366-
keyboard shortcuts, toward the top of the notebook click
1364+
between code and markdown modes. Your selected cell will be surrounded
1365+
by a <em>blue</em> border when you are in command mode. For a complete listing
1366+
of keyboard shortcuts, toward the top of the notebook click
13671367
<code class="docutils literal"><span class="pre">Help</span> <span class="pre">&gt;</span> <span class="pre">Keyboard</span> <span class="pre">Shortcuts</span></code>. The most critical shortcuts are:</p>
13681368
<ul class="simple">
13691369
<li>create a new cell above the current cell: <code class="docutils literal"><span class="pre">a</span></code></li>
@@ -1383,7 +1383,7 @@ <h2>Familiarizing Yourself with Jupyter Notebooks<a class="headerlink" href="#Fa
13831383
<li>execute current cell and then create a new cell below:
13841384
<code class="docutils literal"><span class="pre">&lt;SHIFT&gt;+&lt;ENTER&gt;</span></code></li>
13851385
</ul>
1386-
<p>By default, a cell will be a code-type cell, meaning that it’s content
1386+
<p>By default, a cell will be a code-type cell, meaning that its content
13871387
will be formatted and executed as Python code. Just as you saw when
13881388
using the IPython notebook, <code class="docutils literal"><span class="pre">&lt;TAB&gt;</span></code> can be used to perform
13891389
autocomplete. Additionally, when your cursor is on the name of a Python
@@ -1401,7 +1401,7 @@ <h3>Markdown Cells<a class="headerlink" href="#Markdown-Cells" title="Permalink
14011401
page</a>
14021402
as a reference for various markdown stylings. Using markdown cells
14031403
allows you to create section and subsection headers for your notebook,
1404-
you can <a class="reference external" href="http://jupyter-notebook.readthedocs.io/en/stable/examples/Notebook/Working%20With%20Markdown%20Cells.html#LaTeX-equations">render latex math
1404+
you can <a class="reference external" href="http://jupyter-notebook.readthedocs.io/en/stable/examples/Notebook/Working%20With%20Markdown%20Cells.html#LaTeX-equations">render LaTeX math
14051405
equations</a>,
14061406
embed images and videos in your notebook, and much more. In fact, every
14071407
page in this website was created using Jupyter notebooks! Markdown-type

docs/Module1_GettingStartedWithPython/Numerical_Work_In_Python.html

+13-13
Original file line numberDiff line numberDiff line change
@@ -196,16 +196,16 @@
196196
<div class="section" id="Doing-Numerical-Work-in-Python">
197197
<h1>Doing Numerical Work in Python<a class="headerlink" href="#Doing-Numerical-Work-in-Python" title="Permalink to this headline"></a></h1>
198198
<p>Python’s elegant and flexible syntax makes it a particularly attractive
199-
language, however this makes Python considerably slower than other, more
200-
stringent languages (e.g., the C programming language). This is a
201-
non-issue in many circumstances. It is, however, a major roadblock when
202-
one is doing serious numerical work.</p>
199+
language. However, this also makes Python considerably slower than
200+
other, more stringent languages (e.g., the C programming language). This
201+
is a non-issue in many circumstances. It is, however, a major roadblock
202+
when one is doing serious numerical work.</p>
203203
<p>Fortunately, there are several packages that you can use in Python,
204-
which allow you to do mathematical computations that actually are
204+
which allow you to do mathematical computations that are actually
205205
executed behind the scenes in a faster language. Offloading the work to
206206
a different language allows the computations to become blazingly fast,
207-
and we, the coders, can stick to writing Python. The two best packages
208-
for this (both of which are already packaged in Anaconda) are:</p>
207+
and we, the programmers, can stick to writing Python. The two best
208+
packages for this (both of which are already packaged in Anaconda) are:</p>
209209
<div class="section" id="NumPy">
210210
<h2>NumPy<a class="headerlink" href="#NumPy" title="Permalink to this headline"></a></h2>
211211
<p>The fundamental package for scientific computing with Python. NumPy
@@ -230,12 +230,12 @@ <h2>NumPy<a class="headerlink" href="#NumPy" title="Permalink to this headline">
230230
</div>
231231
<div class="section" id="Numba">
232232
<h2>Numba<a class="headerlink" href="#Numba" title="Permalink to this headline"></a></h2>
233-
<p>Numba gives you the power to speed up your applications with high
234-
performance functions written directly in Python. Where NumPy restricts
235-
you to using numpy-functions on numpy-arrays, Numba allows you to write
236-
your own custom functions in Python and it will optimize your functions
237-
to get C-like efficiency. This isn’t a magic bullet - Numba can
238-
“translate” only a small subset of the Python language thus far. You
233+
<p>Numba gives you the power to speed up your applications with
234+
high-performance functions written directly in Python. Where NumPy
235+
restricts you to using NumPy functions on NumPy arrays, Numba allows you
236+
to write your own custom functions in Python and it will optimize your
237+
functions to get C-like efficiency. This isn’t a magic bullet - Numba
238+
can “translate” only a small subset of the Python language thus far. You
239239
have to tailor your code to be “compatible” with Numba, which can be
240240
limiting.</p>
241241
<p>We will not be using this package in this course, but it is a tremendous

0 commit comments

Comments
 (0)