Skip cells when running Jupyter Notebook scripts
There is a surprisingly simple way to turn off specific cells in Jupyter Notebook without having to manually comment-out chunks of code.
The simple solution is to place the cursor into the cell that you want to silence, then press Esc
+ r
. The cell will then transform into “raw” (Raw NBConvert) format and be skipped-over when the entire script is run.
To revert it back, press Esc
+ y
to return it to “code” format for re-inclusion.
If you simply want to comment-out a single cell, you can highlight the text and press Ctrl
+ /
. This can be toggled.
Comments
One response to “Skip cells when running Jupyter Notebook scripts”
Very Handy!