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

后端 未结 7 2272
南笙
南笙 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:02

    Currently, there is no such feature included in the IPython notebook. Nevertheless, there are some possibilities to make your life easier, like:

    • use the %store or maybe better the %%cache magic (extension) to store the results of these intermittently cells, so they don't have to be recomputed (see https://github.com/rossant/ipycache)

    • add a if==0: before the cells you don't want to execute

    • convert these cells to raw cells (but you will loose the already stored output!)

    (see discussion at https://github.com/ipython/ipython/issues/2125)

    Jakob

提交回复
热议问题