Jupyter Notebook:用于隐藏单元格输出的命令? [英] Jupyter Notebook: command for hide the output of a cell?
问题描述
在我的笔记本中,我有一个单元格返回温度计算结果.它有点长,所以在运行之后,我想隐藏它,并在需要时显示它.
In my notebook, I have a cell returning temp calculation results. It's a bit long, so after it is run, I want to hide it and when needed, to show it.
要手动执行此操作,我可以双击输出的左侧以将其隐藏
To do it manually, I can double click the left side of the output, to hide it
双击后
但是我有什么办法可以通过代码来做到这一点?例如,
But is there any way I can do this by code? For example,
单元格的最后一行,使用%%hide output
之类的命令,并且在完成运行后将隐藏输出.
the last line of the cell, use a command like %%hide output
, and the output would be hidden after finished running.
此外,我可以在输出HTML中获得此功能吗?
Additionally, can I get this feature in output HTML?
推荐答案
在单元格末尾添加;
以隐藏该单元格的输出.
Add ;
by the end of the cell to hide the output of that cell.
这篇关于Jupyter Notebook:用于隐藏单元格输出的命令?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!