how do i store a function’s output without re-running the function in spyder?

(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.

Leave a Comment

Your email address will not be published.

Scroll to Top