Sunday, 28 November 2021

Upon restarting a Jupyter notebook, automatically run 1st/nth cell only (to load modules and other variables), ideally using a keyboard shortcut

In addition to loading required modules, in the first cell of the jupyter notebook, I usually load variables (e.g. metadata, tables etc.). So every time when I restart a jupyter notebook, I need to run the 1st cell of the notebook. I know this is not a big issue, but sometimes can be an annoyance. For example, if I would be working at the end of the notebook and need to restart it, I would have to scroll all the way up, run the first cell, and then scroll all the way back to resume the work.

I hope there is a way to automatically run 1st (or any n'th) cell of a jupyter notebook when it is restarted. I wonder if anybody knows if such a functionality exists.



from Upon restarting a Jupyter notebook, automatically run 1st/nth cell only (to load modules and other variables), ideally using a keyboard shortcut

No comments:

Post a Comment