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
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
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.