启动
jupyter notebook
安装扩展
conda install -c conda-forge jupyter_contrib_nbextensions
代码规范
推荐 Code prettify
或者 autopep8
变量命名神器
输入要起名的变量(支持中英文),点击搜索后,网站下方会给出变量的起名建议
- Search 基于当前命名搜索其它相关的命名
- Repo 链接到使用该命名的代码所在的资源库
- Copy 复制该命名
- Codes 查看使用命名的示例代码
同时输出多个结果
%config ZMQInteractiveShell.ast_node_interactivity='all'
%pprint
默认情况下,只能输出最后一个
解决显示不全
Numpy
# numpy 完整输出大数组
import sys
np.set_printoptions(threshold=sys.maxsize)
Pandas
#显示所有行
pd.set_option('display.max_rows', None)
#显示所有列
pd.set_option('display.max_columns', None)
#设置浮点数
pd.set_option('display.float_format', lambda x: '%.5f' % x)