How to: Hide all the warnings in Jupyter Notebooks

If you’re a data scientist, there’s a good chance that you spend a healthy chunk of time working in Jupyter Notebooks.

Every now and then, you might do something that triggers a warning (such as ::ahem:: using a deprecated method from the Pandas package).

That warning can get end up consuming a whole lot of screen real estate, especially if it’s part of a looping function.

One way to deal with those warnings is to simply make them disappear by adding the following chunk in a cell near the top of the notebook:

import warnings
warnings.filterwarnings('ignore')