Skip to content

Commit c73603f

Browse files
committed
Add mask for NA to _arith_method
1 parent 218e5cd commit c73603f

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

Diff for: pandas/core/array_algos/masked_reductions.py

-3
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212

1313
from pandas._libs import missing as libmissing
1414

15-
from pandas.core.missing import isna
1615
from pandas.core.nanops import check_below_min_count
1716

1817
if TYPE_CHECKING:
@@ -58,8 +57,6 @@ def _reductions(
5857
else:
5958
return func(values, axis=axis, **kwargs)
6059
else:
61-
mask |= isna(values)
62-
6360
if check_below_min_count(values.shape, mask, min_count) and (
6461
axis is None or values.ndim == 1
6562
):

Diff for: pandas/core/arrays/masked.py

+2
Original file line numberDiff line numberDiff line change
@@ -767,6 +767,8 @@ def _arith_method(self, other, op):
767767

768768
with np.errstate(all="ignore"):
769769
result = pd_op(self._data, other)
770+
if op_name == "truediv":
771+
mask |= isna(result)
770772

771773
if op_name == "pow":
772774
# 1 ** x is 1.

0 commit comments

Comments
 (0)