本文推荐Jupyter Notebook 16个超实用插件,续前篇:
本文速览
窗口分面:Scratchpad
Markdown文本高亮:Highlighter
Cell标记、锁定:Runtools
代码折叠:Code folding
example、document快速获取:Snippets menu
PEP8 代码优化:Code prettify
代码补全:Hinterland
显示行号:Toggle all line numbers
添加目录:Table of Contents (2)
按标题折叠:Collapsible headings
文件过滤:Tree Filter
代码字号收缩:Code Font Size
字符选中高亮:Highlight selected word
快捷键编辑:Keyboard shortcut editor
编辑模式切换:Select CodeMirror Keymap
变量收集浮窗:Variable Inspector
插件安装
pip install jupyter_contrib_nbextensions -i https://pypi.tuna.tsinghua.edu.cn/simple
jupyter contrib nbextension install --user
pip install jupyter_nbextensions_configurator -i
以上三步结束,重新启动jupyter notebook即可搞定,出现以下表示安装完毕。
下面分享一些个人感觉实用的插件:
窗口分面:Scratchpad
新开一个窗口,在数据分析过程中非常有用,比如你画了个图,想对照着图看绘图数据、或者看看修改参数后的效果图。快捷键:Ctrl键+B键

Markdown文本高亮:Highlighter
高亮Markdown cell中选择的文本。
%%javascript
require("base/js/utils").load_extensions("highlighter/highlighter")

Cell标记、锁定:Runtools
该插件为为默认Cell的一个很好补充,先看下cell本来具有的功能:

代码折叠:Code folding
代码折叠
Document快速获取:Snippets menu
快速添加python、常见模块的example、document等等。
PEP8规范优化代码:Code prettify
按照PEP8 Python编码规范:《PEP 8 -- Style Guide for Python Code》美化代码,依赖Google开发的YAPF模块。
pip install yapf -i https://pypi.tuna.tsinghua.edu.cn/simple

代码补全:Hinterland
代码自动补全。
显示行号:Toggle all line numbers
显示代码行号。

添加目录:Table of Contents (2)
给notebook添加目录
按标题折叠:Collapsible headings
notebook按标题折叠
文件过滤:Tree Filter
文件过滤。
代码字号收缩:Code Font Size
代码块字体放大缩小。
字符选中高亮:Highlight selected word
高亮选中的字符。
快捷键编辑:Keyboard shortcut editor
编辑、删除已有快捷键;添加新的快捷键。
编辑模式切换:Select CodeMirror Keymap
如果你习惯了使用 emacs, vim, and sublime,该插件非常适合你。变量收集浮窗:Variable Inspector
使用浮窗表格收集notebook中的变量信息。
参考资料:https://github.com/ipython-contrib/jupyter_contrib_nbextensions
更多好文,欢迎关注:pythonic生物人
网友评论