How To Create Jupyter Notebook File

This article will tell you how to create a Jupyter notebook file, what is the structure of the file and what content can you write in the file.

1. Create Jupyter Notebook File Steps.

  1. Click the New drop-down list on jupyter notebook home page top right corner.
  2. There is a list of menu items in the drop-down list.
  3. If you click the Folder submenu item, it will create a folder in the current jupyter web server folder. You should rename the folder on the server-side, and then the new folder name will be displayed on the web page.
  4. If you click the Python 3 submenu item, it will open a new browser tab to show the new python 3 script editing window.
  5. The top area of this tab window is the file operation menu bar. You can Insert, Delete, Copy, Paste python code in this window.
  6. After you input the python source code in each line, if you click the run button, it will display the code execution result under the code line.

2. Jupyter Notebook File Structure Introduction.

  1. Jupyter notebook file structure should follow the below rules.
  2. A document consists of a series of cells, one cell one line.
  3. Each cell is a multiline text input box.
  4. Cell content can be executed by press the shift + enter key, click the play button on the toolbar,  or the command in the cell menu on the menu bar.
  5. The execution behavior of a cell is determined by the type of cell.
  6. There are four types of cells: code cell, markdown markup language text cell, title cell, and raw cell.
  7. When you insert a cell line, it original type is code. But you can change it’s type by clicking Cell —> Cell Type —> Code / Markdown / Raw NBConvert menu item.

3. Jupyter Notebook Cell Type Introduction.

  1. Code Type: This cell type allows you to edit and write new code with syntax highlighting and tab autocomplete. The programming language used depends on the kernel, the default kernel is python.
  2. When a code cell is executed, the code it contains is sent to the associated kernel, the kernel returns the result after calculation and displays the output after the corresponding cell.
  3. Output is not limited to text, there are many other possible forms of output, including Matplotlib diagrams, HTML, and so on.
  4. Markdown Type: Cell that can write markdown markup text.
  5. Raw Type: Used to write output directly. A notebook doesn’t do anything with it. It outputs whatever you edit.

Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.