Re: [Numpy-discussion] ufunc.accumulate question

2010-10-08 Thread Chris Withers
Thanks for this, very informative! :-) Chris On 06/10/2010 17:35, Friedrich Romstedt wrote: > 2010/10/5 Chris Withers: >> Hi All, >> >> I can't find any docs on this behavior. >> >> So, I have a python function. To keep it simple, lets just do addition: >> >> def add(x,y): >>print x,y >>r

Re: [Numpy-discussion] ufunc.accumulate question

2010-10-06 Thread Friedrich Romstedt
2010/10/5 Chris Withers : > Hi All, > > I can't find any docs on this behavior. > > So, I have a python function. To keep it simple, lets just do addition: > > def add(x,y): >   print x,y >   retun x+y > > So, I can turn this into a ufunc as follows: > > uadd = np.frompyfunc(add,2,1) As a side rem

[Numpy-discussion] ufunc.accumulate question

2010-10-05 Thread Chris Withers
Hi All, I can't find any docs on this behavior. So, I have a python function. To keep it simple, lets just do addition: def add(x,y): print x,y retun x+y So, I can turn this into a ufunc as follows: uadd = np.frompyfunc(add,2,1) Now, I can apply it to an array: >>> uadd.accumulate(np.