@@ -80,16 +80,14 @@ def _can_use_numexpr(op, op_str, a, b, dtype_check):
80
80
# check for dtype compatibility
81
81
dtypes = set ()
82
82
for o in [a , b ]:
83
- if hasattr (o , "dtypes" ):
84
- # Series implements dtypes, check for dimension count
85
- if o .ndim > 1 :
86
- s = o .dtypes .value_counts ()
87
- if len (s ) > 1 :
88
- return False
89
- dtypes |= set (s .index .astype (str ))
90
- else :
91
- dtypes |= {o .dtypes .name }
92
- elif isinstance (o , np .ndarray ):
83
+ # Series implements dtypes, check for dimension count as well
84
+ if hasattr (o , "dtypes" ) and o .ndim > 1 :
85
+ s = o .dtypes .value_counts ()
86
+ if len (s ) > 1 :
87
+ return False
88
+ dtypes |= set (s .index .astype (str ))
89
+ # ndarray and Series Case
90
+ elif hasattr (o , "dtype" ):
93
91
dtypes |= {o .dtype .name }
94
92
95
93
# allowed are a superset
@@ -183,7 +181,7 @@ def _has_bool_dtype(x):
183
181
184
182
185
183
def _bool_arith_check (
186
- op_str , a , b , not_allowed = frozenset (("/" , "//" , "**" )), unsupported = None
184
+ op_str , a , b , not_allowed = frozenset (("/" , "//" , "**" )), unsupported = None
187
185
):
188
186
if unsupported is None :
189
187
unsupported = {"+" : "|" , "*" : "&" , "-" : "^" }
0 commit comments