Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to loop through multiple cells in Jupyter / iPython Notebook [duplicate]

I've got a Jupyter Notebook with a couple hundred lines of code in it, spread across about 30 cells. If I want to loop through 10 cells in the middle (e.g. using a For Loop), how do you do that? Is it even possible, or do you need to merge all the code in your loop into one cell?

like image 809
RJH2 Avatar asked Jul 15 '16 21:07

RJH2


1 Answers

The only way I can see to do it would be to join the cells, and then put the entire thing in a for/while loop.

like image 80
BluCode Avatar answered Sep 18 '22 17:09

BluCode