Skip to content

Commit

Permalink
Install pandas
Browse files Browse the repository at this point in the history
  • Loading branch information
palewire committed Feb 12, 2017
1 parent aedee83 commit 4c4a976
Show file tree
Hide file tree
Showing 6 changed files with 115 additions and 7 deletions.
Binary file modified docs/_build_html/.doctrees/environment.pickle
Binary file not shown.
Binary file modified docs/_build_html/.doctrees/index.doctree
Binary file not shown.
46 changes: 44 additions & 2 deletions docs/_build_html/_sources/index.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,8 @@ Act 1: Hello Jupyter Notebook
-----------------------------

A `Jupyter Notebook <http://jupyter.org/>`_ is a browser application where you can write, run, remix and republish code. It is free
software you can install and run like any other open-source library. It is used by scientists, researchers
and corporations to create and share their analysis.
software you can install and run like any other open-source library. It is used by scientists, scholars, investors
and corporations to create and share their work.

It's also used by journalists to develop stories and show their work. Examples include:

Expand Down Expand Up @@ -210,3 +210,45 @@ Start up the notebook from your terminal.
That will open up a new tab in your default web browser that looks something like this:

.. image:: /_static/notebook.png


Click the "New" button in the upper right and create a new Python 2 notebook. Now you're all setup and ready to start writing code.

Don't stress. There's nothing too fancy about it. You can start by just doing a little simple math.

Type the following into the first box, then hit the play button in the toolbox (or hit SHIFT+ENTER on your keyboard).

.. code-block:: python
2+2
There. You've just written your first Python code. You've entered two integers (the 2's) and added them together using the plus sign operator. Not so bad, right?

Now's the time for us to get our hands on some real data and get some real work done.

Act 2: Hello pandas

Lucky for us, Python already has tools filled with functions to do pretty much anything you’d ever want to do with a programming language: navigate the web, parse data, interact with a database, run fancy statistics, build a pretty website and so much more.

Some of those tools are included a toolbox that comes with the language, known as the standard library. Others have been built by members of Python's developer community and need to be downloaded and installed from the web.

For this exercise, we're going to install and use [pandas](http://pandas.pydata.org/), a tool developed at a financial investment firm that has become the leading open-source tool for accessing and analyzing data.

We'll install pandas the same way we installed the Jupyter Notebook earlier: Our friend ``pip``. Save your notebook, switch to your window/command prompt and hit ``CTRL-C``. That will kill your notebook and return you to the command line. There we'll install pandas.

.. code-block:: python
pip install pandas
Now let's restart our notebook and get back to work.

.. code-block:: python
jupyter notebook
Use the next open box to import pandas into our script, so we can use all its fancy methods here in our script.


.. code-block:: python
import pandas as pd
28 changes: 26 additions & 2 deletions docs/_build_html/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -245,8 +245,8 @@ <h4>For Windows<a class="headerlink" href="#id7" title="Permalink to this headli
<div class="section" id="act-1-hello-jupyter-notebook">
<h2>Act 1: Hello Jupyter Notebook<a class="headerlink" href="#act-1-hello-jupyter-notebook" title="Permalink to this headline"></a></h2>
<p>A <a class="reference external" href="http://jupyter.org/">Jupyter Notebook</a> is a browser application where you can write, run, remix and republish code. It is free
software you can install and run like any other open-source library. It is used by scientists, researchers
and corporations to create and share their analysis.</p>
software you can install and run like any other open-source library. It is used by scientists, scholars, investors
and corporations to create and share their work.</p>
<p>It&#8217;s also used by journalists to develop stories and show their work. Examples include:</p>
<ul class="simple">
<li><a class="reference external" href="https://github.com/BuzzFeedNews/2016-01-tennis-betting-analysis/blob/master/notebooks/tennis-analysis.ipynb">&#8220;The Tennis Racket&#8221;</a> by BuzzFeed and the BBC</li>
Expand Down Expand Up @@ -283,6 +283,30 @@ <h2>Act 1: Hello Jupyter Notebook<a class="headerlink" href="#act-1-hello-jupyte
</div>
<p>That will open up a new tab in your default web browser that looks something like this:</p>
<img alt="_images/notebook.png" src="_images/notebook.png" />
<p>Click the &#8220;New&#8221; button in the upper right and create a new Python 2 notebook. Now you&#8217;re all setup and ready to start writing code.</p>
<p>Don&#8217;t stress. There&#8217;s nothing too fancy about it. You can start by just doing a little simple math.</p>
<p>Type the following into the first box, then hit the play button in the toolbox (or hit SHIFT+ENTER on your keyboard).</p>
<div class="highlight-python"><div class="highlight"><pre><span></span><span class="mi">2</span><span class="o">+</span><span class="mi">2</span>
</pre></div>
</div>
<p>There. You&#8217;ve just written your first Python code. You&#8217;ve entered two integers (the 2&#8217;s) and added them together using the plus sign operator. Not so bad, right?</p>
<p>Now&#8217;s the time for us to get our hands on some real data and get some real work done.</p>
<p>Act 2: Hello pandas</p>
<p>Lucky for us, Python already has tools filled with functions to do pretty much anything you’d ever want to do with a programming language: navigate the web, parse data, interact with a database, run fancy statistics, build a pretty website and so much more.</p>
<p>Some of those tools are included a toolbox that comes with the language, known as the standard library. Others have been built by members of Python&#8217;s developer community and need to be downloaded and installed from the web.</p>
<p>For this exercise, we&#8217;re going to install and use [pandas](<a class="reference external" href="http://pandas.pydata.org/">http://pandas.pydata.org/</a>), a tool developed at a financial investment firm that has become the leading open-source tool for accessing and analyzing data.</p>
<p>We&#8217;ll install pandas the same way we installed the Jupyter Notebook earlier: Our friend <code class="docutils literal"><span class="pre">pip</span></code>. Save your notebook, switch to your window/command prompt and hit <code class="docutils literal"><span class="pre">CTRL-C</span></code>. That will kill your notebook and return you to the command line. There we&#8217;ll install pandas.</p>
<div class="highlight-python"><div class="highlight"><pre><span></span><span class="n">pip</span> <span class="n">install</span> <span class="n">pandas</span>
</pre></div>
</div>
<p>Now let&#8217;s restart our notebook and get back to work.</p>
<div class="highlight-python"><div class="highlight"><pre><span></span><span class="n">jupyter</span> <span class="n">notebook</span>
</pre></div>
</div>
<p>Use the next open box to import pandas into our script, so we can use all its fancy methods here in our script.</p>
<div class="highlight-python"><div class="highlight"><pre><span></span><span class="kn">import</span> <span class="nn">pandas</span> <span class="kn">as</span> <span class="nn">pd</span>
</pre></div>
</div>
</div>
</div>

Expand Down
2 changes: 1 addition & 1 deletion docs/_build_html/searchindex.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

46 changes: 44 additions & 2 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,8 @@ Act 1: Hello Jupyter Notebook
-----------------------------

A `Jupyter Notebook <http://jupyter.org/>`_ is a browser application where you can write, run, remix and republish code. It is free
software you can install and run like any other open-source library. It is used by scientists, researchers
and corporations to create and share their analysis.
software you can install and run like any other open-source library. It is used by scientists, scholars, investors
and corporations to create and share their work.

It's also used by journalists to develop stories and show their work. Examples include:

Expand Down Expand Up @@ -210,3 +210,45 @@ Start up the notebook from your terminal.
That will open up a new tab in your default web browser that looks something like this:

.. image:: /_static/notebook.png


Click the "New" button in the upper right and create a new Python 2 notebook. Now you're all setup and ready to start writing code.

Don't stress. There's nothing too fancy about it. You can start by just doing a little simple math.

Type the following into the first box, then hit the play button in the toolbox (or hit SHIFT+ENTER on your keyboard).

.. code-block:: python
2+2
There. You've just written your first Python code. You've entered two integers (the 2's) and added them together using the plus sign operator. Not so bad, right?

Now's the time for us to get our hands on some real data and get some real work done.

Act 2: Hello pandas

Lucky for us, Python already has tools filled with functions to do pretty much anything you’d ever want to do with a programming language: navigate the web, parse data, interact with a database, run fancy statistics, build a pretty website and so much more.

Some of those tools are included a toolbox that comes with the language, known as the standard library. Others have been built by members of Python's developer community and need to be downloaded and installed from the web.

For this exercise, we're going to install and use [pandas](http://pandas.pydata.org/), a tool developed at a financial investment firm that has become the leading open-source tool for accessing and analyzing data.

We'll install pandas the same way we installed the Jupyter Notebook earlier: Our friend ``pip``. Save your notebook, switch to your window/command prompt and hit ``CTRL-C``. That will kill your notebook and return you to the command line. There we'll install pandas.

.. code-block:: python
pip install pandas
Now let's restart our notebook and get back to work.

.. code-block:: python
jupyter notebook
Use the next open box to import pandas into our script, so we can use all its fancy methods here in our script.


.. code-block:: python
import pandas as pd

0 comments on commit 4c4a976

Please sign in to comment.