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 32
32
from pandas .core .dtypes .common import (
33
33
ensure_float64 ,
34
34
is_bool ,
35
- is_float_dtype ,
36
35
is_integer ,
37
- is_integer_dtype ,
38
36
is_list_like ,
39
37
is_scalar ,
40
38
needs_i8_conversion ,
@@ -270,18 +268,14 @@ def _prep_values(self, values: Optional[np.ndarray] = None) -> np.ndarray:
270
268
if values is None :
271
269
values = extract_array (self ._selected_obj , extract_numpy = True )
272
270
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 ):
280
272
raise NotImplementedError (
281
273
f"ops for { self ._window_type } for this "
282
274
f"dtype { values .dtype } are not implemented"
283
275
)
284
276
else :
277
+ # GH #12373 : rolling functions error on float32 data
278
+ # make sure the data is coerced to float64
285
279
try :
286
280
values = ensure_float64 (values )
287
281
except (ValueError , TypeError ) as err :
You can’t perform that action at this time.
0 commit comments