Hi ,
I am recently start learning python for data analysis and jupyter , I create one file in Jupyter Notebook first day everything is working fine but when i start working on next day and re open the file , i am unable to continue my work where i left and. I have to re run whole code again in jupyter notebook , everytime i have to run whole code or is there any trick or some function i need to change in jupyter notebook so that i can continue my work where i left .
I hope someone will help me in this
Thanks
You have to run the whole code.
Everytime i have to run whole code in Jupyter notebook
The way that I am interpreting your questions, yes, everytime. Are you using it on your home pc or are you logging into a hub and performing your work there?
Inside Cell 1 :
Import pandas as pd
Import numpy as np
Inside cell 2 :
Df = “file path “
Inside cell 3
Print(head.())
So on like this and i just saved this work in jupyter notebook although code is available in the jupter notebook but the cell exuction is vanished so tomorrow i want to continue from the last step but its seems like i have to run all the code from very first step
That is true, the state of the Python Kernel (variables, function definitions etc.) is not saved. The visualisation is misleading here.
So is there any alternative of this
It is technically not feasible to serialize and save the whole state of a Python script at a given point since the code might contain the usage of ressources that are not available anymore, such as network connections etc. IF there is any solution, it could never cover all cases.
2 Likes
You can move from a locally installed Jupyter notebook server to a JupyterHub hosted on another system. Persistence can be added if you are willing to support the cost of the hub system running constantly (or while you need it). Additionally, some institutions and companies already offer managed versions of this. You’ll want to keep your eyes and ears open to see if you can tap in or need to pay for that. Some offer different levels of ‘persistence’, such as you have 48 hours for a notebook to run before it is shutdown and the output is saved.
If you can leave everything open and running overnight, you’ll be able to pick up at the last executed cell.
1 Like
I got one more solution , if we re run the kernel it will run all the cells