convert json ipython notebook(.ipynb) to .py file

后端 未结 10 2232
灰色年华
灰色年华 2020-12-02 12:28

How do you convert an IPython notebook file (json with .ipynb extension) into a regular .py module?

10条回答
  •  难免孤独
    2020-12-02 12:49

    From the notebook menu you can save the file directly as a python script. Go to the 'File' option of the menu, then select 'Download as' and there you would see a 'Python (.py)' option.

    Another option would be to use nbconvert from the command line:

    jupyter nbconvert --to script 'my-notebook.ipynb'
    

    Have a look here.

提交回复
热议问题