Reproducible-Science-Curriculum / introduction-RR-Jupyter

Introduction materials for Reproducible Research Curriculum with Jupyter notebook
Creative Commons Zero v1.0 Universal
11 stars 10 forks source link

Clearing the cells for a saved notebook #27

Open psychemedia opened 7 years ago

psychemedia commented 7 years ago

If you try to print the internet out into an output cell, the kernel may fall over and you may have problems trying to open the notebook.

Clear the cells in a saved notebook using the command:

jupyter nbconvert --to notebook --ClearOutputPreprocessor.enabled=True NOTEBOOK.ipynb

to generate a notebook with empty output cells: NOTEBOOK.nbformat.ipynb

or add the --inplace flag to save the notebook with cleaned output cells to the same filename.