[Numpy-discussion] A bug in numarray sign function.

Nadav Horesh NadavH at VisionSense.com
Wed Jan 5 02:31:00 CST 2005

in numarraycore.py line 1504 should be changed from

    return zeros(shape(m))-less(m,0)+greater(m,0)


    return zeros(shape(m))-ufunc.less(m,0)+ufunc.greater(m,0)

otherwise sign function raises an error:

/usr/local/lib/python2.4/site-packages/numarray/numarraycore.py in sign(m)
   1502     """
   1503     m = asarray(m)
-> 1504     return zeros(shape(m))-less(m,0)+greater(m,0)
   1506 def alltrue(array, axis=0):

NameError: global name 'less' is not defined


More information about the Numpy-discussion mailing list