Jupyter Notebook
Jupyter Notebook is a simple way to organize Python (and Julia, and R, although we don't use either of those two languages within Jupyter Notebooks [except maybe Julia?]) code into cells that can be run independently. You can intersperse code with Markdown-formatted text explaining it and type out math via inline LaTeX syntax. Writing and running code in notebooks makes things a lot easier, with the simple caveat that the files that are produced when saving are .ipynb
files, which cannot be run in the same way as .py
files can from the command line.
Most of the work we do in ORIE with Python is done through Jupyter Notebooks. Instructors can create Notebooks and have students fill in missing code, allowing them to get to the heart of an algorithm without writing a ton of boilerplate or having an overly deep understanding of the Python language itself.
You can try Jupyter in your browser here: https://docs.jupyter.org/en/latest/start/index.html
Installation
You can install Jupyter Notebook with the command python -m pip install jupyter
, or by following this installation guide: Installation guide.
If you don't have pip
installed, read instructions on installing it here: pip website.
If you don't have Python installed, download it here (Python website), or use Anaconda instead.
Usage
Jupyter Notebooks are pretty easy to use. Make sure you check out the keyboard shortcuts when you have a Notebook open, by going to Help > Keyboard Shortcuts, or by pressing H
.
Colab
Google Colab is an online version of Jupyter Notebook. Go here to learn about Colab: Colab wiki page.