早在去年在
Coursera 上学 Julia 的时候就用过 Jupyter
Notebook,当时感觉没啥特别的。然鹅最近和连老师交流的时候突然发现了 Jupyter
的妙处,就像一个美人儿,看一眼觉得还行,多看几眼就发现了韵味,所以写篇 Jupyter 配置笔记来记录一下。
目录
1. 为什么使用
Jupyter Notebook
官网上的解释:
The notebook extends the console-based approach to interactive
computing in a qualitatively new direction, providing a web-based
application suitable for capturing the whole computation process:
developing, documenting, and executing code, as well as
communicating the results. The Jupyter notebook combines two
components:
A
web application: a browser-based tool for interactive authoring of
documents which combine explanatory text, mathematics, computations
and their rich media output.
Notebook documents: a representation of all content visible in the
web application, including inputs and outputs of the computations,
explanatory text, mathematics, images, and rich media
representations of objects.
总结起来就是一个汇集开发、执行和文档为一体,而且支持包含 Python、Julia、Stata、R、Ruby、Matlab、SAS
等多种语言并可以实现交互式代码的网页版 IDE。直观来讲是 IPython
在多种语言上的网页版外推。有了这个神器,我们能规避掉的目前主流 IDE 里存在的问题包括但不局限于:
在
IDE 里测试,看不到每个部分的 output 效果。在命令行里测试,则没法轻松撤销前面的代码
没办法一边编辑一边显示每部分执行的效果,
没办法一边编辑一边在旁边用 Markdown 做笔记
不方便和合作者协同交互
所以
Jupyter Notebook 真的是个很酷的小东西了 hhh。