File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Expand file tree Collapse file tree 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
110110 np .prod (result .shape )):
111111 return result
112112
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 ):
118114
119115 # if we don't have any elements, just astype it
120116 if not np .prod (result .shape ):
@@ -146,6 +142,9 @@ def trans(x): # noqa
146142 # hit here
147143 if (new_result == result ).all ():
148144 return new_result
145+ elif (issubclass (dtype .type , np .floating ) and
146+ not is_bool_dtype (result .dtype )):
147+ return result .astype (dtype )
149148
150149 # a datetimelike
151150 # GH12821, iNaT is casted to float
You can’t perform that action at this time.
0 commit comments