jupyter notebook扩展插件

2019-11-01  本文已影响0人  长歌行夜一

用conda安装:

conda install -c conda-forge jupyter_contrib_nbextensions

conda install -c conda-forge jupyter_nbextensions_configurator

或者用pip:

pip install jupyter_nbextensions_configurator jupyter_contrib_nbextensions

jupyter contrib nbextension install --user

jupyter nbextensions_configurator enable --user

1.魔法函数

1)

%prun  执行函数

告诉你函数的耗时情况

2)

%matplotlib inline 作图时,最后一句函数不输出显示,只需在语句后加分号:plt.hist(data);

3)写shell命令

!ls 目录

4)调试工具: %pdb

5)

%%writefile xxx.py  # 到处cell内容到一个文件

%pycat xxx.py   # 语法高亮展示一个文件(外部脚本)

6)%%time

告诉你一个cell里的运行时间

%%timeit 加语句

告诉你一个语句的平均运行时间 (默认语句运行100000次,提供最快的三次的平均值)

上一篇 下一篇

猜你喜欢

热点阅读