Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Saving Jupyter notebook session

I am currently trying to save my whole Jupyter Notebook environment (working throught Anaconda 3).
By environment, I mean, all the objects created (dataframes, lists, tuples, models, …).

Unfortunately I don’t have Linux even though there seemed to be Linux command solutions.
I tried finding a solution with pickle as recommended in the following topic but it seems that you have to specify which objects you want to dump and load.

saving-and-loading-multiple-objects-in-pickle

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

What I would like to do is that everything saves and loads as it can be done with R, where you just save and load an .RData file.

>Solution :

You can use Dill to store your session

pip install dill

Save a Notebook session:

import dill
dill.dump_session('notebook_env.db')

Restore a Notebook session:

import dill
dill.load_session('notebook_env.db')
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading