8000 BUG: in DataFrame.reset_index() only call maybe_upcast_putmask with ndarrays by arw2019 · Pull Request #36876 · pandas-dev/pandas · GitHub
[go: up one dir, main page]

Skip to content

BUG: in DataFrame.reset_index() only call maybe_upcast_putmask with ndarrays #36876

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Oct 11, 2020
Next Next commit
BUG: add check so maybe_upcast_putmask is only called with ndarray
  • Loading branch information
arw2019 committed Oct 9, 2020
commit fee7b1a45e0e8b275f07e3ca23c40170da10726c
2 changes: 1 addition & 1 deletion pandas/core/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -4879,7 +4879,7 @@ def _maybe_casted_values(index, labels=None):
if issubclass(values_type, DatetimeLikeArray):
values = values._data # TODO: can we de-kludge yet?

if mask.any():
if mask.any() and isinstance(values, np.ndarray):
values, _ = maybe_upcast_putmask(values, mask, np.nan)

if issubclass(values_type, DatetimeLikeArray):
Expand Down
0