diff --git a/numpy/core/src/multiarray/reduction.h b/numpy/core/src/multiarray/reduction.h index 9de44de61b81..761497be126f 100644 --- a/numpy/core/src/multiarray/reduction.h +++ b/numpy/core/src/multiarray/reduction.h @@ -43,7 +43,7 @@ typedef int (PyArray_AssignReduceUnitFunc)(PyArrayObject *result, * npy_intp count = *countptr; * * // Skip any first-visit elements - * if (NpyIter_IsFirstVisit(iter, 1)) { + * if (NpyIter_IsFirstVisit(iter, 0)) { * if (stride0 == 0) { * --count; * --skip_first_count; diff --git a/numpy/core/src/umath/ufunc_object.c b/numpy/core/src/umath/ufunc_object.c index a86c67c2d288..643e1d6f0822 100644 --- a/numpy/core/src/umath/ufunc_object.c +++ b/numpy/core/src/umath/ufunc_object.c @@ -2881,7 +2881,7 @@ PyUFunc_Reduce(PyUFuncObject *self, PyArrayObject *arr, PyArrayObject *out, npy_intp count = *count_ptr; /* Skip any first-visit elements */ - if (NpyIter_IsFirstVisit(iter, 1)) { + if (NpyIter_IsFirstVisit(iter, 0)) { if (stride[0] == 0) { --count; --skip_first_count; @@ -2933,7 +2933,7 @@ PyUFunc_Reduce(PyUFuncObject *self, PyArrayObject *arr, PyArrayObject *out, npy_intp count = *count_ptr; /* Skip any first-visit elements */ - if (NpyIter_IsFirstVisit(iter, 1)) { + if (NpyIter_IsFirstVisit(iter, 0)) { if (stride[0] == 0) { --count; --skip_first_count;