My notebook gets a bit of long, I divide it into several parts.
Sometimes, I just want to run a certain part of it, i.e consecutive cells
For example,
I want to run Cell IN [52] to[54]
, not run IN [51],[59]
. How can I do it?
I only know there is option for run above
, run below
, I didn't see anything like run selected cells
.
UPDATE: Now Jupyter Notebook has this feature built-it, simply CTRL + click
UPDATE as per Jan 2018: You can select and run multiple cells in command mode using the below shortcuts:
1.shift+K (select the cells in an upward direction) and then Ctrl+Enter
2.shift+J (select the cells in a downward direction) and then Ctrl+Enter
I found a useful extension that performs a similar function: init_cell. First, you will need to install jupyter nbextensions configurator as described here.
Then search for "Initialization cells" from inside the search bar of the Jupyter nbextension manager.
A check box at the top of every cell will appear. You can select which cells to be marked as initialization cells.
To run all the initialization cells at once, click the button with calculator symbol on the tool bar:
Along with cqcn1991's solution, you can gain a reasonable control over your notebook.
I know this is not the answer your are looking for (because its not the answer I was looking for) but for your specific case of running cells 52-54, because they are sequential and continuous, you can simply click the play button (run cell and select below) 3 times
and it will queue those cells for running. This will work for a handful of sequential cells, but for out of sequence or really long blocks of cells, probably not the best ideal
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With