1.使用命令jupyter notebook启动,启动之后我们在浏览器端看到Jupyter server的页面,这里显示当前目录的tree
2.创建一个notebook, 点击 New按钮, 选择Notebook的kernel(如Python 3).
3.这里主要包括了两个notebook cell:Markdown cell和code cell
选择code cell,输入:
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
print("hello world!")
plt.imshow(np.random.rand(20,20),interpolation='none');
from IPython.display import display_html
from IPython.html.widgets import FloatSlider
display_html('<table><tr><td>some</td><td>table</td></tr></table>',raw=True)
FloatSlider(value=70)
4.Markdown cell和code cell这两种模式下的快捷键
• Ctrl + Enter: run the cell
• Shift + Enter: run the cell and select the cell below
• Alt + Enter: run the cell and insert a new cell below
• Ctrl + S: save the notebook
5.编辑模式下的快捷键
• Esc: switch to command mode
• Ctrl + Shift + -: split the cell
6.命令行模式下的快捷键
• Enter: switch to edit mode
• ↑ or k: select the previous cell
• ↓ or j: select the next cell
• y / m: change the cell type to code cell/Markdown cell
• a / b: insert a new cell above/below the current cell
• x / c / v: cut/copy/paste the current cell
• dd: delete the current cell
• z: undo the last delete operation
• Shift + =: merge the cell below
• h: display the help menu with the list of keyboard shortcuts