Skip to content

Commit 797c790

Browse files
committed
Avoid (maybe) unnecessary cast to float dtype
1 parent b17113e commit 797c790

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pandas/core/series.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -4224,7 +4224,7 @@ def _try_cast(arr, take_fast_path):
42244224
try:
42254225
# gh-15832: Check if we are requesting a numeric dype and
42264226
# that we can convert the data to the requested dtype.
4227-
if is_float_dtype(dtype) or is_integer_dtype(dtype):
4227+
if is_integer_dtype(dtype):
42284228
subarr = maybe_cast_to_integer_array(arr, dtype)
42294229

42304230
subarr = maybe_cast_to_datetime(arr, dtype)

0 commit comments

Comments
 (0)