Skip to content

Commit e051303

Browse files
authored
CLN: simplify combine_first (#20972)
1 parent fc50bde commit e051303

File tree

1 file changed

+1
-16
lines changed

1 file changed

+1
-16
lines changed

pandas/core/frame.py

+1-16
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@
4343
is_extension_array_dtype,
4444
is_datetimetz,
4545
is_datetime64_any_dtype,
46-
is_datetime64tz_dtype,
4746
is_bool_dtype,
4847
is_integer_dtype,
4948
is_float_dtype,
@@ -52,7 +51,6 @@
5251
is_dtype_equal,
5352
needs_i8_conversion,
5453
_get_dtype_from_object,
55-
_ensure_float,
5654
_ensure_float64,
5755
_ensure_int64,
5856
_ensure_platform_int,
@@ -4887,20 +4885,7 @@ def combine(self, other, func, fill_value=None, overwrite=True):
48874885
else:
48884886
arr = func(series, otherSeries)
48894887

4890-
if do_fill:
4891-
arr = _ensure_float(arr)
4892-
arr[this_mask & other_mask] = np.nan
4893-
4894-
# try to downcast back to the original dtype
4895-
if needs_i8_conversion_i:
4896-
# ToDo: This conversion should be handled in
4897-
# _maybe_cast_to_datetime but the change affects lot...
4898-
if is_datetime64tz_dtype(new_dtype):
4899-
arr = DatetimeIndex._simple_new(arr, tz=new_dtype.tz)
4900-
else:
4901-
arr = maybe_cast_to_datetime(arr, new_dtype)
4902-
else:
4903-
arr = maybe_downcast_to_dtype(arr, this_dtype)
4888+
arr = maybe_downcast_to_dtype(arr, this_dtype)
49044889

49054890
result[col] = arr
49064891

0 commit comments

Comments
 (0)