Skip to content

Commit d47de45

Browse files
committed
CLN: remove unneded try/except in nanops
1 parent 5b525b4 commit d47de45

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

pandas/core/nanops.py

+2-5
Original file line numberDiff line numberDiff line change
@@ -1075,11 +1075,8 @@ def reduction(
10751075

10761076
if (axis is not None and values.shape[axis] == 0) or values.size == 0:
10771077
dtype_max = _get_dtype_max(dtype)
1078-
try:
1079-
result = getattr(values, meth)(axis, dtype=dtype_max)
1080-
result.fill(np.nan)
1081-
except (AttributeError, TypeError, ValueError):
1082-
result = np.nan
1078+
result = getattr(values, meth)(axis, dtype=dtype_max)
1079+
result.fill(np.nan)
10831080
else:
10841081
result = getattr(values, meth)(axis)
10851082

0 commit comments

Comments
 (0)