When using Jupyter notebook, outputs (include error messages) from executing a cell can be useful and so I'd like to freeze the cell alone with its outputs, or in another word, to inactivate the cell in order to keep the output.
Is this doable?
This freezes the cell, but not the output:
Open the notebook in an editor.
Look for the cell you want to lock.
Add the following lines to the metadata of the cell:
"metadata": {
"trusted": true,
"editable": false,
"deletable": false
}
Save and reload the notebook in Jupyter and... Tadah!, your cell can't be modified or deleted.
Unfortunately, the outputs can still be cleared by intentionally selecting that option in the menu bar (Edit
> Clear Ouputs
). Of course that can only happen if you DO WANT to clear the outputs and not just update them by running the cell.
Source
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With