Getting Started with Jupyter Notebooks

Contents

Getting Started with Jupyter Notebooks#

A carnet interactif (notebook) is an interactive document that allows you to mix narration, interaction, visualization, calculation or programming.

In this first notebook,

you will discover the three essential operations for using a notebook: reading,

executing, editing.

Definition

An interactive notebook is composed of a sequence of cellules (cell).

Each cell can contain rich text, a calculation to be performed, visualizations,

etc. The cellule active (active cell) is framed, which allows to see its scope.

The author of the document has previously specified the properties of each cell.

Exercise 1: Discovering cells

  1. Click in different places in this document to activate the cells that compose it one after the other and see their scope.

Exercise 2: Using executable cells

  1. Click in the cell below, then type Shift+Enter (the Shift key is usually accompanied by the symbol ⇧; on English keyboards, it is denoted Shift). This will execute the calculation \(1+1\) and display the result:

1 + 1
2

Similarly, execute the cells below, modifying the calculations to be performed according to

your taste:

2 * 3
6
2 * (3 + 4)
14

Attention

In this sheet, the calculation examples have been deliberately chosen to be very

simple; of course, the advantage of Jupyter is to provide access to much more

rich calculations.

Exercise 3: Modifying text cells

  1. Enter your first and last names and favorite color in the cell below.Hint: Double-click on the text cell; when you are finished, press the Shift+Enter keys.

  2. Try to modify the cell where this text is written; you will find that it is locked.

  • Name:

  • First name:

  • Favorite color:

^^^html_block

Conclusion#

You now know how to read, execute, and edit a Jupyter notebook. This will be sufficient

initially to use pre-existing notebooks.