File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -1323,11 +1323,8 @@ def _check_1d(x):
1323
1323
"always" ,
1324
1324
category = Warning ,
1325
1325
message = 'Support for multi-dimensional indexing' )
1326
- try :
1327
- ndim = x [:, None ].ndim
1328
- except AssertionError :
1329
- # catch https://github.com/pandas-dev/pandas/issues/35527
1330
- return np .asanyarray (x )
1326
+
1327
+ ndim = x [:, None ].ndim
1331
1328
# we have definitely hit a pandas index or series object
1332
1329
# cast to a numpy array.
1333
1330
if len (w ) > 0 :
@@ -1338,7 +1335,10 @@ def _check_1d(x):
1338
1335
if ndim < 2 :
1339
1336
return np .atleast_1d (x )
1340
1337
return x
1341
- except (IndexError , TypeError ):
1338
+ # In pandas 1.1.0, multidimensional indexing leads to an AssertionError for some
1339
+ # Series objects, but should be IndexError as described in
1340
+ # https://github.com/pandas-dev/pandas/issues/35527
1341
+ except (AssertionError , IndexError , TypeError ):
1342
1342
return np .atleast_1d (x )
1343
1343
1344
1344
You can’t perform that action at this time.
0 commit comments