[英]do i have to restart the kernel everytime I run a jupyter notebook?
I am completely new in data-science and the jupyter notebook world.我是数据科学和 jupyter notebook 世界的新手。 Is there any way to start from where I left on without restarting the whole notebook?
有没有办法从我离开的地方开始而不重新启动整个笔记本?
ie I did some operations on a dataset and get a final_data.即我对一个数据集做了一些操作并得到一个final_data。 Whenever I want to use that final_data after shutting down and opening, I get NameError: name 'final_data' is not defined.
每当我想在关闭和打开后使用该 final_data 时,我都会得到 NameError: name 'final_data' is not defined。 How to solve this?
如何解决这个问题?
I think that's how the Jupyter Notebook works.我认为这就是 Jupyter Notebook 的工作原理。 You have to run all the notebook again.
您必须再次运行所有笔记本。 I go to
Cell>Run All
after opening my notebook.打开我的笔记本后,我 go 到
Cell>Run All
。
It depends whether you are using Google Colab or a simple Jupyter notebook, I think you are using simple Jupyter, however, I will discuss my experience with both.这取决于您使用的是 Google Colab 还是简单的 Jupyter 笔记本,我认为您使用的是简单的 Jupyter,但是,我将讨论我对两者的体验。
For Google Colab: Runtime is destroyed with inactivity and you have to run it again from the start.对于 Google Colab:运行时因不活动而被破坏,您必须从头开始再次运行它。
For Jupyter Notebook: If the notebook tab is open on your browser, the results will not be cleared with time (due to inactivity) as long as you close the tab itself.对于 Jupyter Notebook:如果笔记本选项卡在您的浏览器上打开,只要您关闭选项卡本身,结果就不会随着时间的推移(由于不活动)而被清除。 If you are shutting down/restarting your pc, you will lose the progress (number of lines which were compiled and run), and there is not an easy way to save the progress.
如果您正在关闭/重新启动您的电脑,您将丢失进度(编译和运行的行数),并且没有简单的方法来保存进度。
The best way is to keep the Jupyter notebook tab open, even if you put your computer in sleep mode (by flipping the lid of your laptop), the data will be retained, until and unless you do not restart or shut down your PC.最好的方法是让 Jupyter 笔记本选项卡保持打开状态,即使您将计算机置于睡眠模式(通过翻转笔记本电脑的盖子),数据仍将保留,直到且除非您不重新启动或关闭您的 PC。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.