Help with ipywidgets example code (capturing widget output)

Hi I came across this tutorial (https://towardsdatascience.com/bring-your-jupyter-notebook-to-life-with-interactive-widgets-bc12e03f0916) and for some reason I can not get the “Capturing Widget Output” example to work. The dropdown widget will display, but if I choose any year or ALL, the dataframe does not render. The code seem straightforward as it is just trying to clear the output before rendering the dataframe. I am running the classic jupyter notebook. I have tried both Brave browser and FireFox and still do not get the intended results.

Here is my gist: https://nbviewer.jupyter.org/gist/pybokeh/0a35c5a8474b94f821bba22949d17d7c

Thanks in advance for any assistance I can get on this. BTW, this is my first post and did not know there was such thing as a Jupyter community forum. I hope this is the correct medium or format for getting this kind of help. If not, I apologize!

Ooops, nevermind! Found what my problem was. The animated gif in the article’s example hid the critical last line that I needed:

display(output_year)

1 Like