如何将Jupyter笔记本显示为仪表板?

问题描述 投票:2回答:1

我想将Jupyter(IPython)笔记本显示为(非交互式)仪表板。

来自普通笔记本,变化是:

  • 显示笔记本,使其不可编辑(如nbviewer.jupyter.org)
  • 在常规计时器上重新运行笔记本(如内核>重新启动和运行全部)
  • 隐藏代码(如jupyter_contrib_nbextensions“隐藏输入全部”或类似内容,但默认情况下应在笔记本加载时启用)
  • (可选但很好)具有笔记本可以循环的多个选项卡或部分

最好的方法是什么?在笔记本电脑上做或者将笔记本电脑转换成只生成静态html网站的东西会更好吗?如果笔记本,如何设置它是不可编辑的,所以它会定期重新运行?

python jupyter-notebook ipython-notebook jupyter dashboard
1个回答
0
投票

您可以生成HTML以嵌入仪表板。通过使用

--no输入

从转换的文档中排除输入单元格和输出提示。

此模式非常适合生成无代码报告。

赶紧跑

jupyter nbconvert \
  --no-input \
  --to html
  --execute test.ipynb 

您甚至可以使用生成默认配置文件

jupyter nbconvert --generate-config

然后设定

## This allows you to exclude code cell inputs from all templates if set to True.
c.TemplateExporter.exclude_input = True

和...一起

## This allows you to exclude output prompts from all templates if set to True.
c.TemplateExporter.exclude_output_prompt = True

您可以使用自定义配置

--config=<Full path of a config file>
© www.soinside.com 2019 - 2024. All rights reserved.