How to (intermittently) skip certain cells when running IPython notebook?

后端 未结 7 2285
南笙
南笙 2020-12-04 15:41

I usually have to rerun (most parts of) a notebook when reopen it, in order to get access to previously defined variables and go on working.

However, sometimes I\'d

7条回答
  •  生来不讨喜
    2020-12-04 16:17

    This question is a bit older, but the most convenient answer seems to be missing. You can use the 'initialization cells' from the NBextensions. Once installed/activated, you can in any notebook mark cells as 'initialization cells' which can then be run with a specific button.

    • Install NBextensions:here
    • Activate 'initialization cells' when you launch the jupyter dashboard

    • In your notebook, in the 'view' menu choose 'cell toolbar' then 'initialization cell'

    • Next to each cell there is now a checkbox. Mark all the cells you want to run for initialization
    • When reopening a notebook, click the button that looks like a pocket calculator to run all the initialization cells.

提交回复
热议问题