jupyter notebook 要点

来源:互联网 发布:保留数据重置win10 编辑:程序博客网 时间:2024/06/05 12:06

1.

Jupyter notebook 源自 Fernando Perez 发起的 IPython 项目。IPython 是一种交互式 shell,与普通的 Python shell 相似,但具有一些很好的功能(例如语法高亮显示和代码补全)。最初,notebook 的工作方式是,将来自 Web 应用(你在浏览器中看到的 notebook)的消息发送给 IPython 内核(在后台运行的 IPython 应用程序)。内核执行代码,然后将结果发送回 notebook。当前架构与之相似,具体见下图。

摘自 [Jupyter 文档](https://jupyter.readthedocs.io/en/latest/architecture/how_jupyter_ipython_work.html)

保存 notebook 时,它将作为 JSON 文件(文件扩展名为 .ipynb)写入到该服务器中.



2.

要在 conda 环境中安装 Jupyter notebook,请使用 conda install jupyter notebook.

也可以通过 pip 使用 pip install jupyter notebook 来获得 Jupyter notebook.


3.

默认情况下,notebook 服务器的运行地址是 http://localhost:8888。该地址的含义是:localhost 表示你的计算机,而 8888 是服务器的通信端口.


4.

在terminal 中输入 jupyter notebook进入notebook界面,会自动弹出web界面,



新建一个文件,选择markdown,若要在code模式之间切换,按ESC,y/m  用来code/markdown模式之间的切换,shift+enter可以执行代码单元格





5.

这里比较方便的功能就是函数的写法



6.

TAB键用来自动补全代码,补全相关变量,函数等,eg: 定义一个数组passenger,pa+TAB可以快速找到.


7.这里给出官方网址

[http://jupyter.org/](http://jupyter.org)



原创粉丝点击