Jupyter notebook插件nbextensions

Jupyter notebook插件nbextensions

nbextensions安装

安装jupyter_contrib_nbextensions

在Anaconda Prompt中输入如下命令

pip install jupyter_contrib_nbextensions

Jupyter notebook插件nbextensions_第1张图片

这个时候重启jupyter notebook发现还是没有

Jupyter notebook插件nbextensions_第2张图片

安装jupyter_nbextensions_configurator

conda install -c conda-forge jupyter_nbextensions_configurator

Jupyter notebook插件nbextensions_第3张图片

现在出现了nbextensions选项卡,但是里面没有东西

Jupyter notebook插件nbextensions_第4张图片

安装 javascript and css files

jupyter contrib nbextension install --user

然后刷新一下页面就出现了nbextensions工具

Jupyter notebook插件nbextensions_第5张图片

nbextensions配置

生成导航栏:Table of Contents(2)

通过markdown语法设置标题可以快速定位代码,使用的时候像word一样方便。

Jupyter notebook插件nbextensions_第6张图片

变量监视器:Variable Inspector

image-20200626191147290

打开Variable Inspector,可以查看变量的值。

word = 'hello'

Jupyter notebook插件nbextensions_第7张图片

word = 'world'

Jupyter notebook插件nbextensions_第8张图片

word = 'hello world'

Jupyter notebook插件nbextensions_第9张图片

显示代码运行时间:ExcecuteTime

打开ExcecuteTime之后可以看到各个cell的运行时间。

Jupyter notebook插件nbextensions_第10张图片

Jupyter notebook插件nbextensions_第11张图片

代码折叠:Codefolding

将代码中的循环、函数等折叠起来,方面调试。

折叠前

image-20200626192047521折叠后

image-20200626192113030

定时自动保存:AutoSaveTime

设置每两分钟保存一次

image-20200626192213495

代码提示:Hinterland

Jupyter notebook插件nbextensions_第12张图片

总结

nbextensions丰富了jupyter notebook的功能,将IDE中的很多功能都移植到了jupyter notebook上。

你可能感兴趣的:(Jupyter notebook插件nbextensions)