Here is an example to let me explain what I would like to achieve:
#+NAME: heavy_computation
#+BEGIN_SRC shell :results table
echo -e "A\t32\nB\t17"
#+END_SRC
#+BEGIN_SRC python :var data=heavy_computation
return sum([i[1] for i in data])
#+END_SRC
The second code block uses the results of the first one. When running the second code block the result is correctly displayed:
#+RESULTS:
: 49
However I would also like to see the results of the first code block, without having to run it independently. Therefore, under the first code block, I would like to see:
#+RESULTS: heavy_computation
| A | 32 |
| B | 17 |
How can I achieve that? My question looks similar to this question but as far as I understood, the anwser seemed specific to Lisp.
:cache yes
but I’m uncertain if that’s what you want. If you add:cache yes
to the expensive block and execute it, the results will be cached and viewable. Other code blocks will use the cached value instead of executing the expensive block again. Is this what you want?