Daily Dose of Data Science

Share this post

Restart Jupyter Kernel Without Losing Variables

www.blog.dailydoseofds.com

Discover more from Daily Dose of Data Science

High-quality insights on Data Science and Python, along with best practices — shared daily. Get a free 550+ page data science PDF guide and 450+ practice questions notebook.
Over 50,000 subscribers
Continue reading
Sign in

Restart Jupyter Kernel Without Losing Variables

A cool Jupyter hack.

Avi Chawla
May 11, 2023
11
Share this post

Restart Jupyter Kernel Without Losing Variables

www.blog.dailydoseofds.com
1
Share

While working in a Jupyter Notebook, you may want to restart the kernel due to several reasons. Instead of dumping the variables to disk before restarting Jupyter and reading them back, use the store magic command.

It allows you to store and retrieve a variable back even if you restart the kernel. This avoids the hassle of dumping the object to disk.

Over to you: What are some other cool Jupyter hacks that you know of?

Thanks for reading Daily Dose of Data Science! Subscribe for free to learn something new and insightful about Python and Data Science every day. Also, get a Free Data Science PDF (250+ pages) with 200+ tips.


Would you like to have a free 1-on-1 call with me?

Hey friends!

Next week, I will open my calendar for you to schedule a 1-on-1 meeting with me.

👉 What you may use this 1-on-1 call for:

  • Project assistance

  • Career guidance

  • Interview preparation, etc.

👉 Here’s how it will work:

By the end of this week (14th May 2023), you have to write a post on Twitter and/or LinkedIn that highlights your experience with this newsletter and how it has helped you.

On Monday (15th May 2023), I will personally reach out to five readers with some of the best reviews and set up a free 1-on-1 meeting with them.

👉 What if you don’t make it to the top five reviewers?

No worries, I understand that you may have shared your experience because you really need my help.

Thus, I will still contact you over LinkedIn/Twitter/Email and provide personal support over chat.

In other words, you will definitely hear from me in any case, and that’s a promise.

👉 What you may write in the social media post:

  • Why is this newsletter special/valuable to you?

  • How long have you been reading this newsletter for?

  • Why would you recommend it to others?

  • and whatever else that potentially comes to your mind :)

👉 Some guidelines:

  • Don’t forget to tag me in your Twitter and/or LinkedIn posts so that I get notified when you post. Find me on LinkedIn and Twitter here: My LinkedIn | My Twitter.

  • Alternatively, you may reply to this email by sharing the post’s link.

  • Share a comprehensive review and try to keep it limited to ~100-120 words.

  • Feel free to post video-based reviews if you wish to.

I look forward to reading your social media posts over the next few days :)

Thanks for reading!


👉 If you liked this post, don’t forget to leave a like ❤️. It helps more people discover this newsletter on Substack and tells me that you appreciate reading these daily insights. The button is located towards the bottom of this email.

👉 If you love reading this newsletter, feel free to share it with friends!

Share Daily Dose of Data Science


Find the code for my tips here: GitHub.

I like to explore, experiment and write about data science concepts and tools. You can read my articles on Medium. Also, you can connect with me on LinkedIn and Twitter.

11
Share this post

Restart Jupyter Kernel Without Losing Variables

www.blog.dailydoseofds.com
1
Share
Previous
Next
1 Comment
Share this discussion

Restart Jupyter Kernel Without Losing Variables

www.blog.dailydoseofds.com
Jack Nelson
May 11

This is super helpful, I did not know about that functionality within jupyter. Thanks!

Expand full comment
Reply
Share
Top
New
Community

No posts

Ready for more?

© 2023 Avi Chawla
Privacy ∙ Terms ∙ Collection notice
Start WritingGet the app
Substack is the home for great writing