I run a Jupyter Notebook (JupyterLab) which does some heavy computation in a loop for e
episodes. DURING THE EXECUTION of the notebook I would like to set the counter x
close to e
, so the loop will finish with the next iteration or so. Is that possible to change a variable at runtime? I would like to stop the this loop early but still execute the whole code of the notebook.
#stuff happening before
for x in range(e):
#important calculations (takes forever)
#stuff happening after
The only way I know to stop the execution is to interrupt, where I would loose the data right?
Thanks in advance. :)