Esempio n. 1
0
            internal static ndarray reduce(NpyArray_Ops ops, object a, int axis = 0, dtype dtype = null, ndarray @out = null, bool keepdims = false)
            {
                ndarray arr = asanyarray(a);

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

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

                return(NpyCoreApi.PerformReduceOp(arr, axis, ops, rtype, @out, keepdims));
            }