Python Notebooks

Notebooks for discovering and learning Python
Author

Ludovic Deneuville

1 Notebooks

To discover Python, we will start by coding in these 5 notebooks:

To create these notebooks, I was inspired by the resources below:

2 Using a notebook

ImportantInstructions
  1. Start by going to one of the 5 notebooks mentioned above
  2. Download the .ipynb file to your machine
  3. Connect to one of the services offered below
  4. Upload the .ipynb file to this service

2.1 Launching a Jupyter service

In the left column:

  • the folder icon allows you to browse files
  • the list icon allows you to display the table of contents

The Code field indicates whether the cell expects Python code or text (Markdown)

Here are other possibilities for using a notebook:

2.2 Cell types

A notebook is made up of cells. You can create a new cell by clicking on the + button in the toolbar. There are two main types of cells:

  • code cells (where you write and execute Python code)
  • text cells (where you write formatted text using Markdown)

It is a simple and intuitive language that allows you to format text (this website is generated with Markdown code).

Many resources are available on the internet, for example

Some examples:

Code Formatting
**bold text** bold text
*italic text* italic text
# Level 1 title
## Level 2 title
- Bullet point item - Bullet point item

The desired cell type can be changed in the toolbar.

3 Useful commands

Command Description
SHIFT + ENTER Execute a cell and move to the next one.
CTRL + ENTER Execute a cell without moving to the next one.
ESC Switch to command mode (cell borders become blue).
ENTER Switch to edit mode (you can modify the cell content).
A Insert a cell above the current cell.
B Insert a cell below the current cell.
D + D Delete a cell.

4 Useful resources

You will find more information about notebooks on the INSEE Python introductory training website.