8000 Backport PR #18167: Catch Pandas AssertionError on deprecated multidi… · matplotlib/matplotlib@bc1a725 · GitHub
[go: up one dir, main page]

Skip to content
8000

Commit bc1a725

Browse files
tacaswellmeeseeksmachine
authored andcommitted
Backport PR #18167: Catch Pandas AssertionError on deprecated multidimensional indexing. Closes #18158
1 parent 9ca7245 commit bc1a725

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/matplotlib/cbook/__init__.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1326,7 +1326,11 @@ def _check_1d(x):
13261326
if ndim < 2:
13271327
return np.atleast_1d(x)
13281328
return x
1329-
except (IndexError, TypeError):
1329+
# In pandas 1.1.0, multidimensional indexing leads to an
1330+
# AssertionError for some Series objects, but should be
1331+
# IndexError as described in
1332+
# https://github.com/pandas-dev/pandas/issues/35527
1333+
except (AssertionError, IndexError, TypeError):
13301334
return np.atleast_1d(x)
13311335

13321336

0 commit comments

Comments
 (0)
0