Stream: general
Topic: python to jupyterbook
Judith Berner (May 26 2021 at 19:14):
I am trying to translate some python code (with lots of functions and loops over the whole code) to a jupyter notebook.
Can you point me to any good documentation on best practices? Can this be automated (and then revised?).
Anderson Banihirwe (May 26 2021 at 19:31):
Can you point me to any good documentation on best practices? Can this be automated (and then revised?).
@Judith Berner, you might find the jupytext
tool to be useful for the from .py
to .ipynb
notebook conversion:
- Installation
conda install -c conda-forge jupytext
# or
python -m pip install jupytext --upgrade
- Convert your python script/file to a notebook
jupytext --to ipynb your_script_file.py
Documentation: https://jupytext.readthedocs.io/en/latest/using-cli.html
Judith Berner (Jun 15 2021 at 21:15):
Thanks so much!
Last updated: Jan 30 2022 at 12:01 UTC