Jupyter Notebooks

A Notebook is made up of a series of executable cells. You can control them from the menues, or see the extensive keyboard short cuts by pressing esc then h.

Making notes

Cells can contain plain text, for example...

Today

  • Cloudy with rain across Scotland and Northern Ireland, the rain heavy in the west with strong winds.
  • Some early mist or fog across England and Wales, soon clearing to a mostly dry day with sunny spells; sunniest in the east.

Tonight

  • Further cloud and rain for Scotland and Northern Ireland, heavy in places.
  • There'll be some clear spells further south, but despite this it will be very mild overnight.

Tuesday

  • Very warm and sunny across much of England, cloudier with possible heavy downpours in some western parts.
  • Remaining unsettled across Scotland and Northern Ireland, sunny spells elsewhere.

or Latex:

$$c = \sqrt{a^2 + b^2}$$

Try making some cells like the ones above. You might want to read about Markdown

Running code

As well as text, you can also...


In [ ]:
print('run Python.')

In [ ]:
print('Each cell is separate from the others...')
print('and can be re-executed on the fly')

You can also run terminal commands if you prepend them with the ! symbol.


In [ ]:
!echo 'like this'

Try making some new code cells.

Multimedia

You can include images, videos and charts in your notebook:


In [ ]:
from IPython.display import YouTubeVideo
YouTubeVideo("lqZ-uJIRv2w")

In [ ]:
import matplotlib
import numpy as np
import matplotlib.pyplot as plt

x = np.linspace(0, 6*np.pi, 500)
plt.plot(x, np.sin(x**2))
plt.title('A simple chirp')
plt.show()

Further info

There are a lot of great examples out there: