How to ignore deprecation warnings in Python

Mohammed picture Mohammed · May 18, 2009 · Viewed 174.3k times · Source

I keep getting this :

DeprecationWarning: integer argument expected, got float

How do I make this message go away? Is there a way to avoid warnings in Python?

Answer

ismail picture ismail · May 18, 2009

You should just fix your code but just in case,

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