BUG/Internals: maybe_upcast_putmask #23823
Labels
Algos
Non-arithmetic algos: value_counts, factorize, sorting, isin, clip, shift, diff
Bug
Dtype Conversions
Unexpected or buggy dtype conversions
Milestone
In the context of #23192 (and #23604 / #23606), I want to use
pandas.core.dtypes.cast.maybe_upcast_putmask
, because it solves exactly the problem I need it to solve.Unfortunately, it does not work as advertised (and I already found the culprit).
The docstring says:
in other words, it expects
result
andother
to be ndarrays. Curiously enough, in some branches, it only works forSeries
and produces wrong results forndarray
, e.g.This is because the code does
which actually expects a
Series
(since.values
won't ever work on an ndarray).The text was updated successfully, but these errors were encountered: