From 85e3f1c9c842b7cfa29179b9310b68ce784c1849 Mon Sep 17 00:00:00 2001 From: hannah Date: Fri, 31 Jan 2020 00:04:20 -0500 Subject: [PATCH] Backport PR #16379: FIX: catch on message content, not module --- 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 0b64644205e4..35eec13ff440 100644 --- a/lib/matplotlib/cbook/__init__.py +++ b/lib/matplotlib/cbook/__init__.py @@ -1414,9 +1414,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