diff --git a/pandas/core/internals/blocks.py b/pandas/core/internals/blocks.py index 8eea46af2c353..c035e1174bb27 100644 --- a/pandas/core/internals/blocks.py +++ b/pandas/core/internals/blocks.py @@ -1366,20 +1366,8 @@ def func(cond, values, other): # np.where will cast integer array to floats in this case other = self._try_coerce_args(other) - try: - fastres = expressions.where(cond, values, other) - return fastres - except Exception as detail: - if errors == "raise": - raise TypeError( - "Could not operate [{other!r}] with block values " - "[{detail!s}]".format(other=other, detail=detail) - ) - else: - # return the values - result = np.empty(values.shape, dtype="float64") - result.fill(np.nan) - return result + fastres = expressions.where(cond, values, other) + return fastres if cond.ravel().all(): result = values