Skip to content

Commit 04ad090

Browse files
committed
combined jupyter-colab with python tutorial, makes much more sense now
1 parent 7a3f2a9 commit 04ad090

File tree

3 files changed

+49
-25
lines changed

3 files changed

+49
-25
lines changed

index.html

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -114,13 +114,7 @@
114114

115115
<div class="materials-item">
116116
<a href="python-numpy-tutorial/">
117-
Python / Numpy Tutorial
118-
</a>
119-
</div>
120-
121-
<div class="materials-item">
122-
<a href="jupyter-colab-tutorial/">
123-
Jupyter Notebook / Google Colab Tutorial
117+
Python / Numpy Tutorial (with Jupyter and Colab)
124118
</a>
125119
</div>
126120
<!--

jupyter-colab-tutorial.md

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,30 +4,29 @@ title: Jupyter Notebook / Google Colab Tutorial
44
permalink: /jupyter-colab-tutorial/
55
---
66

7-
To get some extra practice with Python, we'll be running the
8-
[Python Numpy Tutorial](python-numpy-tutorial.md) as a Jupyter
9-
notebook or [Google Colaboratory](https://research.google.com).
10-
117
A Jupyter notebook lets you write and execute
12-
Python code locally in your web browser. Jupyter notebooks
8+
Python code *locally* in your web browser. Jupyter notebooks
139
make it very easy to tinker with code and execute it in bits
1410
and pieces; for this reason they are widely used in scientific
1511
computing.
16-
Google has released a flavor of Jupyter notebooks called Colaboratory
17-
that runs entirely in the cloud. Colab is basically Jupyter notebook on
18-
steroids: it's free, requires no setup, comes preinstalled with many packages,
19-
is easy to share with the world, and benefits from free access to hardware
20-
accelerators like GPUs and TPUs (with some caveats).
12+
Colab on the other hand is Google's flavor of
13+
Jupyter notebooks that is particularly suited for machine
14+
learning and data analysis and that runs entirely in the *cloud*.
15+
Colab is basically Jupyter notebook on steroids: it's free, requires no setup,
16+
comes preinstalled with many packages, is easy to share with the world,
17+
and benefits from free access to hardware accelerators like GPUs and TPUs (with some caveats).
2118

22-
If you wish to run this tutorial in Colab, click the `Open in Colab` badge below.
19+
To get yourself familiar with Python and notebooks, we'll be running
20+
a short tutorial as a standalone Jupyter or Colab notebook. If you wish
21+
to use Colab, click the `Open in Colab` badge below.
2322

2423
<div>
2524
<a href="https://colab.research.google.com/github/cs231n/cs231n.github.io/blob/master/python-colab.ipynb" target="_blank">
2625
<img class="colab-badge" src="/assets/badges/colab-open.svg" alt="Colab Notebook"/>
2726
</a>
2827
</div>
2928

30-
Otherwise, if you're reading this far, we're assuming you wish to run the notebook locally. If your virtual environment was installed correctly (as per the [setup instructions]({{site.baseurl}}/setup-instructions/)), activate it, then run `pip install notebook` to install Jupyter notebook. Next, [open the notebook](https://raw.githubusercontent.com/cs231n/cs231n.github.io/master/jupyter-notebook-tutorial.ipynb) and download it to a directory of your choice by right-clicking on the page and selecting `Save Page As`. Then `cd` to that directory and run the following in your terminal:
29+
If you wish to run the notebook locally make sure your virtual environment was installed correctly (as per the [setup instructions]({{site.baseurl}}/setup-instructions/)), activate it, then run `pip install notebook` to install Jupyter notebook. Next, [open the notebook](https://raw.githubusercontent.com/cs231n/cs231n.github.io/master/jupyter-notebook-tutorial.ipynb) and download it to a directory of your choice by right-clicking on the page and selecting `Save Page As`. Then `cd` to that directory and run the following in your terminal:
3130

3231
```
3332
jupyter notebook

python-numpy-tutorial.md

Lines changed: 37 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
layout: page
3-
title: Python Numpy Tutorial
3+
title: Python Numpy Tutorial (with Jupyter and Colab)
44
permalink: /python-numpy-tutorial/
55
---
66

@@ -18,14 +18,17 @@ help of a few popular libraries (numpy, scipy, matplotlib) it becomes a powerful
1818
environment for scientific computing.
1919

2020
We expect that many of you will have some experience with Python and numpy;
21-
for the rest of you, this section will serve as a quick crash course both on
22-
the Python programming language and on the use of Python for scientific
23-
computing.
21+
for the rest of you, this section will serve as a quick crash course on both
22+
the Python programming language and its use for scientific
23+
computing. We'll also introduce notebooks, which are a very convenient way
24+
of tinkering with Python code. Some of you may have previous knowledge in Matlab,
25+
in which case we also recommend the [numpy for Matlab users](http://wiki.scipy.org/NumPy_for_Matlab_Users)
26+
page.
2427

25-
Some of you may have previous knowledge in Matlab, in which case we also recommend the [numpy for Matlab users](http://wiki.scipy.org/NumPy_for_Matlab_Users) page.
2628

27-
Table of contents:
29+
**Table of Contents**
2830

31+
- [Jupyter and Colab Notebooks](#jupyter-and-colab-notebooks)
2932
- [Python](#python)
3033
- [Python versions](#python-versions)
3134
- [Basic data types](#basic-data-types)
@@ -52,6 +55,34 @@ Table of contents:
5255
- [Subplots](#subplots)
5356
- [Images](#images)
5457

58+
## Jupyter and Colab Notebooks
59+
60+
A Jupyter notebook lets you write and execute
61+
Python code *locally* in your web browser. Jupyter notebooks
62+
make it very easy to tinker with code and execute it in bits
63+
and pieces; for this reason they are widely used in scientific
64+
computing.
65+
Colab on the other hand is Google's flavor of
66+
Jupyter notebooks that is particularly suited for machine
67+
learning and data analysis and that runs entirely in the *cloud*.
68+
Colab is basically Jupyter notebook on steroids: it's free, requires no setup,
69+
comes preinstalled with many packages, is easy to share with the world,
70+
and benefits from free access to hardware accelerators like GPUs and TPUs (with some caveats).
71+
72+
**Run Tutorial in Colab (recommended)**. If you wish to run this tutorial entirely in Colab, click the `Open in Colab` badge at the very top of this page.
73+
74+
**Run Tutorial in Jupyter Notebook**. If you wish to run the notebook locally with Jupyter, make sure your virtual environment is installed correctly (as per the [setup instructions]({{site.baseurl}}/setup-instructions/)), activate it, then run `pip install notebook` to install Jupyter notebook. Next, [open the notebook](https://raw.githubusercontent.com/cs231n/cs231n.github.io/master/jupyter-notebook-tutorial.ipynb) and download it to a directory of your choice by right-clicking on the page and selecting `Save Page As`. Then `cd` to that directory and run `jupyter notebook`.
75+
76+
<div class='fig figcenter'>
77+
<img src='/assets/ipython-tutorial/file-browser.png'>
78+
</div>
79+
80+
This should automatically launch a notebook server at `http://localhost:8888`.
81+
If everything worked correctly, you should see a screen like this, showing all
82+
available notebooks in the current directory. Click `jupyter-notebook-tutorial.ipynb`
83+
and follow the instructions in the notebook. Otherwise, you can continue reading the
84+
tutorial with code snippets below.
85+
5586
<a name='python'></a>
5687

5788
## Python

0 commit comments

Comments
 (0)