从笔记本中保存Jupyter笔记本的html [英] Save html of a Jupyter notebook from within the notebook

查看:158
本文介绍了从笔记本中保存Jupyter笔记本的html的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的Jupyter探索性工作流程如下:

My Jupyter workflow for exploratory analysis looks like:

  1. 修饰一些参数.
  2. 运行笔记本;产生输出.
  3. 眼球输出.
  4. 重复.

任何人都可以建议一个命令来使笔记本保存其自身的副本(例如,将其保存为输出文件夹中的html),以便如果我要重新创建特定的实验(来自特定参数集的结果),我可以这样做是吗?

Can anyone suggest a command to make the notebook to save a copy of itself (e.g as an html in the output folder), so that if I want to recreate a particular experiment (results from a particular parameter set) I can do so?

推荐答案

可以.只需使用细胞魔术添加一个安全的细胞.使用nbconvert之后,您可以重命名文件并附加日期

Yes you can. Just add a safe cell by using cell magic. After using nbconvert you can rename the file and append a date

%%bash
jupyter nbconvert --to html MyNotebookName.ipynb
mv MyNotebookName.html $(date +"%m_%d_%Y-%H%M%S")_MyNotebookName.html

这篇关于从笔记本中保存Jupyter笔记本的html的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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