Mode | What | Shortcut |
---|---|---|
Either (Press Esc to enter) |
Run cell | Shift-Enter |
Command | Add cell below | B |
Command | Add cell above | A |
Command | Delete a cell | d-d |
Command | Go into edit mode | Enter |
Edit (Press Enter to enable) |
Indent | Clrl-] |
Edit | Unindent | Ctrl-[ |
Edit | Comment section | Ctrl-/ |
Edit | Function introspection | Shift-Tab |
Try some below
In [1]:
print('hello world!')
A horizontal rule:
Indented text
Code snippet:
import numpy as np
a2d = np.random.randn(100).reshape(10, 10)
LaTeX inline equation:
$\Delta =\sum_{i=1}^N w_i (x_i - \bar{x})^2$
LaTeX table:
First Header | Second Header |
---|---|
Content Cell | Content Cell |
Content Cell | Content Cell |
HTML:
NB: You can return to the homepage by clicking the Jupyter icon in the very upper left corner at any time
So, what's that number after
In
orOut
? That's the order of running this cell relative to other cells (useful for keeping track of what order cells have been run). When you save this notebook that number along with any output shown will also be saved. To reset a notebook go to Cell -> All Output -> Clear and then Save it.
You can do something like this to render a publicly available notebook on github statically (this I do as a backup for presentations and course stuff):
http://nbviewer.jupyter.org/github/<username>/<repo name>/blob/master/<notebook name>.ipynb
like:
http://nbviewer.jupyter.org/github/michhar/rpy2_sample_notebooks/blob/master/TestingRpy2.ipynb
Also, you can upload or start a new interactive, free notebook by going here:
https://tmpnb.org
The nifty thing about Jupyter notebooks (and the .ipynb files which you can download and upload) is that you can share these. They are just written in JSON language. I put them up in places like GitHub and point people in that direction.
Some people (like this guy who misses the point I think) really dislike notebooks, but they are really good for what they are good at - sharing code ideas plus neat notes and stuff in dev, teaching interactively, even chaining languages together in a polyglot style. And doing all of this on github works really well (as long as you remember to always clear your output before checking in - version control can get a bit crazy otherwise).
In [2]:
import json
In [ ]:
# hit Tab at end of this to see all methods
json.
# hit Shift-Tab within parenthesis of method to see full docstring
json.loads()
In [ ]:
?sum()
In [ ]:
import json
?json
The MIT License (MIT)
Copyright (c) 2016 Micheleen Harris
In [ ]: