(arg, tol: float | np.ndarray)
| 1617 | |
| 1618 | |
| 1619 | def _zero_out_fperr(arg, tol: float | np.ndarray): |
| 1620 | # #18044 reference this behavior to fix rolling skew/kurt issue |
| 1621 | if isinstance(arg, np.ndarray): |
| 1622 | return np.where(np.abs(arg) < tol, 0, arg) |
| 1623 | else: |
| 1624 | return arg.dtype.type(0) if np.abs(arg) < tol else arg |
| 1625 | |
| 1626 | |
| 1627 | @disallow("M8", "m8") |