Beispiel #1
0
            internal static ndarray reduceat(NpyArray_Ops ops, object a, object indices, int axis = 0, dtype dtype = null, ndarray @out = null)
            {
                ndarray arr = asanyarray(a);

                if (arr == null)
                {
                    throw new ValueError("unable to convert a to ndarray");
                }

                ndarray indicesarr = asanyarray(indices);

                if (indicesarr == null)
                {
                    throw new ValueError("unable to convert indices to ndarray");
                }

                NPY_TYPES rtype = dtype != null ? dtype.TypeNum : arr.Dtype.TypeNum;

                return(NpyCoreApi.PerformReduceAtOp(arr, indicesarr, axis, ops, rtype, @out));
            }