Skip to content

Commit aad9e29

Browse files
committed
fill mask in index with nan when not calling maybe_upcast_putmask
1 parent db4dbb1 commit aad9e29

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

pandas/core/frame.py

+7-2
Original file line numberDiff line numberDiff line change
@@ -4847,8 +4847,13 @@ def _maybe_casted_values(index, labels=None):
48474847
if issubclass(values_type, DatetimeLikeArray):
48484848
values = values._data # TODO: can we de-kludge yet?
48494849

4850-
if mask.any() and isinstance(values, np.ndarray):
4851-
values, _ = maybe_upcast_putmask(values, mask, np.nan)
4850+
print(mask)
4851+
if mask.any():
4852+
if isinstance(values, np.ndarray):
4853+
values, _ = maybe_upcast_putmask(values, mask, np.nan)
4854+
else:
4855+
# GH24206
4856+
values[mask] = np.nan
48524857

48534858
if issubclass(values_type, DatetimeLikeArray):
48544859
values = values_type(values, dtype=values_dtype)

0 commit comments

Comments
 (0)