在代码中保存具有特定名称的木工笔记本 [英] save a juptyer notebook with specific name within the code

查看:63
本文介绍了在代码中保存具有特定名称的木工笔记本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Jupyter笔记本,它或多或少是工作方式的模板".例如,笔记本是说每个国家的经济数据的模板.所有的地块和分析都是标准化的.

I have a Jupyter notebook that is more or a less a 'template' of how things are done. For example the notebook is a template of say each country's economic data. All of the plots, and analysis is standardized.

我正在寻找一种以编码方式完成此保存的方法,而不是自己手动命名.反正有没有,如果我有一个标记为:

I'm looking for a way to have this saving done in a coded way rather than manually naming it myself. Is there anyway so that if I have a variable labeled as:

  my_assignment = 'india'

我可以将笔记本名称另存为

I could save the notebook name as

  file_name =   my_assignment + todays_date

 save(file_name)

我用python编写代码.

I code in python.

推荐答案

您可能必须跳到%%javascript才能与Jupyter进行交互,这与发送python代码的ipython内核不同到,例如:

You may have to jump to %%javascript to interact with Jupyter, which is different to the ipython kernel that the python code is sent to, e.g.:

%%javascript
Jupyter.notebook.copy_notebook()

不确定您可以使用特定名称进行复制.
您可以通过以下方式以编程方式重命名当前笔记本:

Not sure you can copy with a specific name.
You can programmaticly rename the current notebook with:

Jupyter.notebook.rename(<new_name>)

这篇关于在代码中保存具有特定名称的木工笔记本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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