(一) 

如何运行: 

  1. Click in the cell below and press "Ctrl+Enter" to run the code
        or
  2. Click in the cell below and press "Shift+Enter" to run the code and move to the next cell
     
  3. Menu: Cell...
    a. > Run Cells runs the highlighted cell(s)
    b. > Run All Above runs the highlighted cell and above
    c. > Run All Below runs the highlighted cell and below

下面图片分别显示了三种不同的运行方式:

  1. jupyter notebook (一)

(二)

在线网页版jupyter notebooks :

add a notebook library

  • New: https://notebooks.azure.com/library > New Library
  • Link: from a shared Azure Notebook library link > open link, sign in> clone and Run
  • Add: open library > Add Notebooks > from computer > navigate to file(s)

working in notebook cells

  • Markdown cells display text in a web page format. Markdown is code that formats the way the cell displays (this cell is Markdown)
     
  • Code cells contain python code and can be interpreted and run from a cell. Code cells display code and output.
     
  • in edit or previously run: cells can display in editing mode or cells can display results of code having been run

 (三)

编辑cells

edit mode

  • text cells in editing mode show markdown code
  • Markdown cells keep editing mode appearance until the cell is run
  • code (python 3) cells in editing look the same after editing, but may show different run output
  • clicking another cell moves the green highlight that indicates which cell has active editing focus

cells need to be saved

  • the notebook will frequently auto save
  • best practice is to manually save after editing a cell using "Ctrl + S" or alternatively, Menu: File > Save and Checkpoint

add a cell

  • Highlight any cell and then... add a new cell using Menu: Insert > Insert Cell Belowor Insert Cell Above
  • Add with Keyboard Shortcut: "ESC + A" to insert above or "ESC + B" to insert below

choose cell type

  • Format cells as Markdown or Code via the toolbar dropdown or Menu: Cell > Cell Type > Code or Markdown
  • Cells default to Code when created but can be reformatted from code to Markdown and vice versa

change notebook page language

  • The course uses Python 3 but Jupyter Notebooks can be in Python 2 or 3 (and a language called R)
  • To change a notebook to Python 3 go to "Menu: Kernel > Change Kernel> Python 3"

 

对cells进行复制、删除、合并等操作如图所示:

jupyter notebook (一)

注:paste是粘贴的意思(也可以用来创建空白的cell),cells在这里翻译成代码块 ,undo指代撤销操作

jupyter notebook (一)

相关文章: