From b53b5884a6a9a73d5f26dd48d5fed905aea098d4 Mon Sep 17 00:00:00 2001 From: Thomas A Caswell Date: Thu, 30 Jan 2020 21:38:33 -0500 Subject: [PATCH] FIX: catch on message content, not module Not all of the warnings from pandas report that they are from pandas. Closes #16295 (again) --- lib/matplotlib/cbook/__init__.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/matplotlib/cbook/__init__.py b/lib/matplotlib/cbook/__init__.py index 7ea6fec67920..e04ef4b3aa7a 100644 --- a/lib/matplotlib/cbook/__init__.py +++ b/lib/matplotlib/cbook/__init__.py @@ -1382,9 +1382,10 @@ def _check_1d(x): # This code should correctly identify and coerce to a # numpy array all pandas versions. with warnings.catch_warnings(record=True) as w: - warnings.filterwarnings("always", - category=DeprecationWarning, - module='pandas[.*]') + warnings.filterwarnings( + "always", + category=DeprecationWarning, + message='Support for multi-dimensional indexing') ndim = x[:, None].ndim # we have definitely hit a pandas index or series object