Skip to content

Commit 9fe548e

Browse files
committed
TEMP: add path for using nanops_numba in masked array reductions
1 parent d3d3c11 commit 9fe548e

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

pandas/core/array_algos/masked_reductions.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
from pandas._libs import missing as libmissing
1414

15-
from pandas.core.nanops import check_below_min_count
15+
from pandas.core.nanops import check_below_min_count, _USE_NUMBA, nanops_numba
1616

1717
if TYPE_CHECKING:
1818
from collections.abc import Callable
@@ -51,6 +51,13 @@ def _reductions(
5151
``min_count`` non-NA values are present the result will be NA.
5252
axis : int, optional, default None
5353
"""
54+
if _USE_NUMBA:
55+
func = getattr(nanops_numba, f"nan{func.__name__}", None)
56+
if func is not None:
57+
return func(
58+
values, mask=mask, skipna=skipna, min_count=min_count, axis=axis
59+
)
60+
5461
if not skipna:
5562
if mask.any() or check_below_min_count(values.shape, None, min_count):
5663
return libmissing.NA

0 commit comments

Comments
 (0)