1、安装

conda install jupyter notebook.

或者pip install jupyter notebook.

2、使用

在终端输入

jupyter notebook

浏览器打开

http://localhost:8888

在Jupyter Notebook中使用conda

conda install nb_conda

 

 安装了nb_conda之后,可以在选择内核时访问任何conda环境。例如,下面的图像显示了在具有多个不同conda环境的机器上创建新笔记本的示例

 3、Magic keywords

关键字是可以在单元中运行的特殊命令,它可以让您控制笔记本身或执行系统调用,比如更改目录。例如,可以使用%matplotlib设置matplotlib在笔记中的交互工作。

Tip: On higher resolution screens such as Retina displays, the default images in notebooks can look blurry. Use %config InlineBackend.figure_format = 'retina' after %matplotlib inline to render higher resolution images.

magic命令的前面分别有一个或两个百分比符号(%或%%),分别表示行magic和单元magic。行magic仅应用于magic命令所写的行,而单元格magic应用于整个单元格。

 

 

4、Timing code

使用timeit magic命令来计算函数运行所需的时间

 

 如果想计算整个单元运行需要多长时间,你可以像这样使用%%timeit:

5、转换成其他格式

For example, to convert a notebook to an HTML file, in your terminal use

 

jupyter nbconvert --to html notebook.ipynb

 

posted on 2020-04-03 19:02  一抹烟霞  阅读(466)  评论(0编辑  收藏  举报

Live2D