Jupyter Notebook使用技巧更新
2020-03-08 13:38
288 查看
持续更新,敬请期待
1. 多行结果输出(jupyter默认输出最后一行的结果)
使用Jupyter的时候有时候发现,我明明写了好几个变量打印,但是它只显示最后一个,[Out]只有一个。可以这样解决:
在Notebook的中开头cell中添加以下代码可以实现多行输出:
from IPython.core.interactiveshell import InteractiveShell InteractiveShell.ast_node_interactivity = 'all' #默认为'last'
例如:
那么每次都这么加两句会很麻烦,如何一劳永逸地在所有文件中实现多行结果输出呢?方法如下:
在路径C:\Users\Administrator.ipython\profile_default下新建ipython_config.py文件,文件代码:
c = get_config() # Run all nodes interactively 使得python可以输出多行,而非只输出最后一行。默认是'last' c.InteractiveShell.ast_node_interactivity = "all"
保存即可。重启Jupyter Notebook可发现,完美实现多个变量输出~~
2. 修改Jupyter Notebook 默认浏览器
3. 打开Jupyter Notebook 时报错:Environment Location Not Found: Not a conda environment:
使用Anaconda安装好Jupyter Notebook后,打开之后点击上方conda时报错如下:
解决方法如下:
更改文件:
F:\Software\anaconda\Lib\sitepackages\nb_conda\envmanger.py
搜索其中的:
return { "environments": [root_env] + [get_info(env) for env in info['envs']] }
改为:
return { "environments": [root_env] + [get_info(env) for env in info['envs'] if env != root_env['dir']] }
重启 jupyter notebook server,错误提示消失。
- 点赞 1
- 收藏
- 分享
- 文章举报
相关文章推荐
- jupyter notebook使用技巧
- jupyter notebook使用技巧--命令行模式以及在Markdown模式使用的操作过程
- jupyter notebook 的使用方法(持续更新)
- jupyter notebook使用技巧
- 【Jupyter NoteBook】- 基本使用以及魔法命令 【持续更新】
- Jupyter notebook 使用技巧
- Python使用seaborn包之路——下载包、更新anaconda3、jupyter notebook切换Python3
- Python-Jupyter Notebook使用技巧
- jupter使用之一《Jupyter Notebook 的 27 个窍门,技巧和快捷键》
- Python·Jupyter Notebook各种使用方法记录·持续更新
- Jupyter notebook 高级使用技巧
- Jupyter notebook 使用 [持续更新]
- Jupyter Notebook常用使用技巧
- jupyter notebook的安装与使用
- Jupyter Notebook使用笔记(一)
- jupyter notebook使用方法
- jupyter notebook即原来的Ipython notebook的使用方法
- jupyter notebook 使用记录
- Mac 中卸载anaconda使用pip安装jupyter notebook
- Jupyter notebook 搭建和使用