在jupyter笔记本中崩溃细胞 [英] collapse cell in jupyter notebook

查看:133
本文介绍了在jupyter笔记本中崩溃细胞的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用ipython Jupyter笔记本。假设我定义了一个在屏幕上占用大量空间的函数。有没有办法折叠细胞?

I am using ipython Jupyter notebook. Let's say I defined a function that occupies a lot of space on my screen. Is there a way to collapse the cell?

我希望函数保持执行和可调用,但我想隐藏/折叠单元格以便更好地可视化笔记本。我怎么能这样做?

I want the function to remain executed and callable, yet I want to hide / collapse the cell in order to better visualize the notebook. How can I do this?

推荐答案

jupyter contrib nbextensions Python包中包含可在笔记本中启用的代码折叠扩展。请点击链接(Github)获取文档。

The jupyter contrib nbextensions Python package contains a code-folding extension that can be enabled within the notebook. Follow the link (Github) for documentation.

使用命令行安装:

pip install jupyter_contrib_nbextensions
jupyter contrib nbextension install --user

生活更容易管理它们,我还建议 jupyter nbextensions配置器 包。这为您的Notebook界面提供了一个额外的选项卡,您可以从中轻松(de)激活所有已安装的扩展程序。

To make life easier in managing them, I'd also recommend the jupyter nbextensions configurator package. This provides an extra tab in your Notebook interface from where you can easily (de)activate all installed extensions.

安装:

pip install jupyter_nbextensions_configurator
jupyter nbextensions_configurator enable --user

这篇关于在jupyter笔记本中崩溃细胞的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆