1
$\begingroup$

When I reopen a project I am working on in the Jupyter Notebook, and trying to add code, the cell restarts at '1' and the only way I can continue to work with my previous objects present is by rerunning all the code. Is there a better way?

$\endgroup$
1
  • 1
    $\begingroup$ Don't close it? Save your results? These are the options. $\endgroup$ – Emre Aug 6 '17 at 23:34
1
$\begingroup$

If you

  • run a jupyter server
  • open a new notebook with one cell: x=1
  • close the notebook
  • re-open the notebook
  • add another cell under the 1st: x+1

it would output 2, showing that the variable you had set is still in memory in the kernel

But, if you completely shutdown the jupyter server, or if you shutdown the kernel of your notebook, then you'll need to re-run the whole thing.

EDIT: JupyterLab is now in Beta and worth trying out as recommended here

$\endgroup$
1
$\begingroup$

You can heat "Kernel" and Choose "Restart & Run All". Then you do not need to run your codes line by line!

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.