Best practices for turning jupyter notebooks into python scripts

后端 未结 4 1406
误落风尘
误落风尘 2021-01-29 19:19

Jupyter (iPython) notebook is deservedly known as a good tool for prototyping the code and doing all kinds of machine learning stuff interactively. But when I use it, I inevitab

4条回答
  •  隐瞒了意图╮
    2021-01-29 20:08

    We are having the similar issue. However we are using several notebooks for prototyping the outcomes which should become also several python scripts after all.

    Our approach is that we put aside the code, which seams to repeat across those notebooks. We put it into the python module, which is imported by each notebook and also used in the production. We iteratively improve this module continuously and add tests of what we find during prototyping.

    Notebooks then become rather like the configuration scripts (which we just plainly copy into the end resulting python files) and several prototyping checks and validations, which we do not need in the production.

    Most of all we are not afraid of the refactoring :)

提交回复
热议问题