美文网首页python进阶
Jupyter notebook 快速入门

Jupyter notebook 快速入门

作者: nummycode | 来源:发表于2017-03-19 10:01 被阅读91次

安装

pip install jupyter

运行notebook服务器

jupyter notebook

结果如下:

$ jupyter notebook
[I 08:58:24.417 NotebookApp] Serving notebooks from local directory: /Users/catherine
[I 08:58:24.417 NotebookApp] 0 active kernels
[I 08:58:24.417 NotebookApp] The Jupyter Notebook is running at: http://localhost:8888/
[I 08:58:24.417 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).

在浏览器中输入http://localhost:8888,就出现了notebook的页面。

Paste_Image.png

也可以指定服务器监听的端口:

jupyter notebook --port 9999

使用下面的命令获取帮助:

jupyter notebook --help

指定配置文件:

jupyter notebook --config=/path/to/myconfig.py

jupyte notebook文件后缀名为".ipynb"。

notebook文档结构

notebook文档结构包括以下几种:

  • code cell :代码单元
  • markdown cell: markdown格式的单元
  • raw cell:原始格式的单元
  • heading cell: 标题单元

常用快捷键

Shift-Enter:执行当前单元,显示输出结果,并跳至下一单元。
Ctrl-Enter:执行当前单元,显示输出结果,但游标依然位于当前单元。
Alt-Enter:执行当前单元,并在下方插入单元
Esc:退出编辑模式,进入视图模式
Enter:进入编辑模式

相关文章

网友评论

    本文标题:Jupyter notebook 快速入门

    本文链接:https://www.haomeiwen.com/subject/fnkmnttx.html