How to disable warnings in Python

There’s a number of different ways to turn off Python warnings. There’s a lot of annoying future deprecation warnings that might flood your console space like crazy. So in order to suppress unwanted warnings in Python, the easiest way is the following:

import warnings
warnings.filterwarnings('ignore')

if you would like disable some specific type of warnings, let’s say Future Warning, then just add a category tag:

import warnings
warnings.filterwarnings("ignore", category=FutureWarning)

Here is a list of various Python warning types.