Hello all! I'm fairly new to Numpy and, while experimenting, I found a strange (i.e. not expected by me!) behaviour of arrays. I tried this (in comment what I get):
x = arange(4) # x = array([0,1,2,3]) def myadd(x,y): # re-define the binary sum function return x + y reduce(myadd, x) # 6, as expected add.reduce(x) # 6, as expected def mysub(x,y): # re-define the binary diff function return x - y reduce(mysub, x) # -6, as expected subtract.reduce(x) # 2 ---> WHY? Can someone explain me this? Thank you in advance! lorenzo.
_______________________________________________ Numpy-discussion mailing list [email protected] http://projects.scipy.org/mailman/listinfo/numpy-discussion
