title: How to pickle or store Jupyter (IPython) notebook session for later
body: <p>Let's say I am doing a larger data analysis in Jupyter/Ipython notebook with lots of time consuming computations done. Then, for some reason, I have to shut down the jupyter local server I, but I would like to return to doing the analysis later, without having to go through all the time-consuming computations again.</p>
  
  <hr>
  
  <p>What I would <strike>like</strike> love to do is <code>pickle</code> or store the whole Jupyter session (all pandas dataframes, np.arrays, variables, ...) so I can safely shut down the server knowing I can return to my session in exactly the same state as before.</p>
  
  <p><strong>Is it even technically possible? Is there a built-in functionality I overlooked?</strong></p>
  
  <hr>
  
  <p><strong>EDIT:</strong> based on <a href="https://stackoverflow.com/a/634581/4050925">this</a> answer there is a <code>%store</code> <a href="http://ipython.org/ipython-doc/rel-0.12/config/extensions/storemagic.html" rel="noreferrer">magic</a> which should be "lightweight pickle". However you have to store the variables manually like so:</p>
  
  <p><code>#inside a ipython/nb session</code><br>
  <code>foo = "A dummy string"</code><br>
  <code>%store foo</code><br>
  <em>closing seesion, restarting kernel</em><br>
  <code>%store -r foo</code> # r for refresh<br>
  <code>print(foo) # "A dummy string"</code></p>
  
  <p>which is fairly close to what I would want, but having to do it manually and being unable to distinguish between different sessions makes it less useful.</p>