Skip to content

Commit 3581073

Browse files
jbrockmendeljreback
authored andcommitted
CLN: remove nested error handling (pandas-dev#27792)
1 parent 3bdac3e commit 3581073

File tree

1 file changed

+2
-14
lines changed

1 file changed

+2
-14
lines changed

pandas/core/internals/blocks.py

+2-14
Original file line numberDiff line numberDiff line change
@@ -1366,20 +1366,8 @@ def func(cond, values, other):
13661366
# np.where will cast integer array to floats in this case
13671367
other = self._try_coerce_args(other)
13681368

1369-
try:
1370-
fastres = expressions.where(cond, values, other)
1371-
return fastres
1372-
except Exception as detail:
1373-
if errors == "raise":
1374-
raise TypeError(
1375-
"Could not operate [{other!r}] with block values "
1376-
"[{detail!s}]".format(other=other, detail=detail)
1377-
)
1378-
else:
1379-
# return the values
1380-
result = np.empty(values.shape, dtype="float64")
1381-
result.fill(np.nan)
1382-
return result
1369+
fastres = expressions.where(cond, values, other)
1370+
return fastres
13831371

13841372
if cond.ravel().all():
13851373
result = values

0 commit comments

Comments
 (0)