(Spyder maintainer here) This is the perfect case for code cells, which are blocks of code that you can evaluate independently.
For that you need to create a cell between value1
and value2
by adding a comment like this between them:
value1 = function1()
# %%
value2 = function2(value1)
Then you can run the cell that contains value1
only once by putting the cursor there and pressing Shift+Enter
. Afterwards, you can modify the contents of the second cell and run it as many times as you want with Shift+Enter
, without evaluating value1
again.
CLICK HERE to find out more related problems solutions.