一直以来都是个伪python使用者,菜,并且习惯于使用jupyter notebook,不敢用.py程序,现在正在慢慢改正中。但在过程中积累的关于jupyter notebook的使用小心得还是希望能记录下来
1 显示目录:安装jupyter notebook插件jupyter_contrib_nbextensions
安装这个最开始的想法是希望jupyter notebook有目录功能。
1.1 windows端如何安装
在本地,用conda安装报错,放弃了,然后根据Jupyter Notebook 添加目录插件使用以下命令
pip install jupyter_contrib_nbextensions
jupyter contrib nbextension install --user --skip-running-check
Ubuntu安装
直接用conda安装,根据打造实用的Jupyter Notebook 扩展插件
conda install -c conda-forge jupyter_contrib_nbextensions
conda install -c conda-forge jupyter_nbextensions_configurator
安装好之后
启动 Jupyter Notebook,开启目录
我常用的2个功能:
- Table of Contents:可以再左侧查看Markdown的大纲视图
- Excecute Time:查看每个代码块执行的时间
jupyter notebook显示行号
在出错误信息的时候,经常说第几行出错了,但jupyter notebook默认是不显示行号的,很不方便。
解决方法:找到菜单View → \rightarrow →
Toggle Line Numbers。