
I am using Numeric 20.2.0. I have found the following inconsistency. I am not a python guru and have no idea how I would fix it myself. The following code creates a series of arrays of data, and then applies maximum.reduce to the array to get the largest value. It then prints the type of returned max value. Most of the returns are typed as an array with a shape of (). If the array is created as a type of 'l' (long) or 'd' (double), the return type is not array. This seems wrong. Can someone tell me if this is expected, and if not, where would I look to change/fix it. --- CODE --- from Numeric import * print "++++" for tc in ('b', 'i', 'l', 's', 'f', 'd'): smallArray = array([1,2,3,4], tc) amax = maximum.reduce(smallArray) print smallArray.typecode(), smallArray, "Max:", amax, type(amax) if type(amax) == type(smallArray): print amax.shape --- OUTPUT ---
participants (1)
-
sag@hydrosphere.com