File tree 1 file changed +4
-5
lines changed
1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -110,11 +110,7 @@ def trans(x): # noqa
110
110
np .prod (result .shape )):
111
111
return result
112
112
113
- # don't convert bool to float GH16875
114
- if (issubclass (dtype .type , np .floating ) and
115
- not is_bool_dtype (result .dtype )):
116
- return result .astype (dtype )
117
- elif is_bool_dtype (dtype ) or is_integer_dtype (dtype ):
113
+ if is_bool_dtype (dtype ) or is_integer_dtype (dtype ):
118
114
119
115
# if we don't have any elements, just astype it
120
116
if not np .prod (result .shape ):
@@ -146,6 +142,9 @@ def trans(x): # noqa
146
142
# hit here
147
143
if (new_result == result ).all ():
148
144
return new_result
145
+ elif (issubclass (dtype .type , np .floating ) and
146
+ not is_bool_dtype (result .dtype )):
147
+ return result .astype (dtype )
149
148
150
149
# a datetimelike
151
150
# GH12821, iNaT is casted to float
You can’t perform that action at this time.
0 commit comments