您的位置:首页 > 其它

Jupyter Notebook的使用

2016-11-12 15:05 627 查看
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
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: