Suppress warnings in Jupyter carefully
Updated August 29, 2026
Suppress warnings only when you understand why they are safe to hide. During development, seeing the warning is often useful.
To hide one known warning category for a limited block:
import warnings
with warnings.catch_warnings():
warnings.filterwarnings("ignore", category=FutureWarning)
warnings.warn("demonstration warning", FutureWarning)
To filter warnings for a particular line or module, make the rule as narrow as possible. A global warnings.filterwarnings("ignore") can conceal a deprecation or invalid-data problem and should not be the default in a shared notebook. Pandas also has its own options, which are separate from Python's warnings module.
Prefer upgrading or changing the deprecated call when the warning identifies a real compatibility issue. If you do suppress a warning in a report, explain the reason in a Markdown cell so another reader can reproduce the result.
Sources
related.
Ruslan Osipov
About the author