Reputation: 2433
I have a radio button widget in a Jupyter notebook and I want to save the selected state, preferrably in the notebook json. That doesn't seem to be happening when I save the notebook. The state gets lost and reset when you reopen the notebook. Is there a way to save the state and have it reload?
Upvotes: 8
Views: 2252
Reputation: 3199
To save a widget state in a jupyter notebook use Save Notebook Widget State
menu item (Widgets>Save Notebook Widget State). From ipywidgets:
A notebook file may be saved with the current widget state as metadata. This allows the notebook file to be rendered with rendered widgets
Upvotes: 1