Skip to content

Commit f42bb7b

Browse files
committed
if column name=='dtype' catch exception
1 parent 8bb2cc1 commit f42bb7b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pandas/core/computation/expressions.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,11 @@ def _where_numexpr(cond, a, b):
159159

160160
def _has_bool_dtype(x):
161161
try:
162-
return x.dtype == bool
162+
if not isinstance(x.dtype, np.dtype):
163+
x = x.rename({'dtype': 'temporary_dtype'}, axis=1)
164+
return x.dtype == bool
165+
else:
166+
return x.dtype == bool
163167
except AttributeError:
164168
try:
165169
return 'bool' in x.dtypes

0 commit comments

Comments
 (0)