gpt4 book ai didi

jupyter-notebook - nbconvert:导出到另一个目录?

转载 作者:行者123 更新时间:2023-12-03 23:39:28 25 4
gpt4 key购买 nike

我想知道是否可以将Jupyter笔记本导出到与笔记本本身不同的目录中?我正在使用它来构建笔记本的HTML版本,并且希望它们位于我的GitHub存储库中的docs/下(这是为了利用GH页)。

最佳答案

NBConvert的--output-dir参数执行此操作:https://nbconvert.readthedocs.io/en/latest/install.html

您可以从命令行或在Jupyter笔记本中使用它。

命令行:

jupyter nbconvert --output-dir='./docs' --to html my_notebook_to_be_converted.ipynb

在Jupyter Notebook单元中:
!jupyter nbconvert --output-dir='./docs' --to html my_notebook_to_be_converted.ipynb

请注意,您不需要使用“--to html”将笔记本转换为html,因为默认输出格式为html。我仅为了清楚起见而包含了该论点。

关于jupyter-notebook - nbconvert:导出到另一个目录?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44099409/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com