About Jupyter
Jupyter notebook is a useful browser-based IPython editor that provides inline documentation via markdown and inline plotting functionality for a one-stop-shop coding and documentation experience. Jupyter is useful for creating living documents for class reports, assignments, or other documents where the results may need to be updated and re-run from time to time, yet still be output in a more professional format than the output of a code execution window.
Using Jupyter
- Open up a command prompt or terminal and type
jupyter notebook
. You can alternately find and run “jupyter notebook” from the windows start menu. A browser with the jupyter folder interface should open. Navigate to the file you want to run and select it. It will open in a new tab and you can use the menu to learn how to run the entire file or one cell at a time. Errors and values will be seen for each cell. - Navigate to a working directory.
- Start a new Python 3 document.
- Enter code in the cells.
- Cells can be code, markdown or raw. code cells are used for executing code, markdown is used for documentation, and raw mode is for plaintext.
- There is a code mode and a cell mode. code entry mode is for entering code or text into the cell, and cell mode is used for running the cell, cutting/pasting, and other operations that affect the layout of one or more cells
- In code entry mode, hit escape when entering text to enter cell mode. Click on text to enter code mode.
- Run the block. In cell mode, use shift+enter to run a block and advance to the next. Use ctrl+enter to execute the cell in place.
- To learn more about jupyter commands, there is a list of them available at help -> keyboard shortcuts.
References
- The help from within jupyter is good for learning how to navigate jupyter with keystrokes…a necessary step for making it usable.
- This site collects some of the best examples, tutorials, etc: https://github.com/jupyter/jupyter/wiki/A-gallery-of-interesting-Jupyter-Notebooks