File tree Expand file tree Collapse file tree 1 file changed +3
-9
lines changed
Expand file tree Collapse file tree 1 file changed +3
-9
lines changed Original file line number Diff line number Diff line change 3232from pandas .core .dtypes .common import (
3333 ensure_float64 ,
3434 is_bool ,
35- is_float_dtype ,
3635 is_integer ,
37- is_integer_dtype ,
3836 is_list_like ,
3937 is_scalar ,
4038 needs_i8_conversion ,
@@ -270,18 +268,14 @@ def _prep_values(self, values: Optional[np.ndarray] = None) -> np.ndarray:
270268 if values is None :
271269 values = extract_array (self ._selected_obj , extract_numpy = True )
272270
273- # GH #12373 : rolling functions error on float32 data
274- # make sure the data is coerced to float64
275- if is_float_dtype (values .dtype ):
276- values = ensure_float64 (values )
277- elif is_integer_dtype (values .dtype ):
278- values = ensure_float64 (values )
279- elif needs_i8_conversion (values .dtype ):
271+ if needs_i8_conversion (values .dtype ):
280272 raise NotImplementedError (
281273 f"ops for { self ._window_type } for this "
282274 f"dtype { values .dtype } are not implemented"
283275 )
284276 else :
277+ # GH #12373 : rolling functions error on float32 data
278+ # make sure the data is coerced to float64
285279 try :
286280 values = ensure_float64 (values )
287281 except (ValueError , TypeError ) as err :
You can’t perform that action at this time.
0 commit comments