He is using the development version of Numpy, which is probably the main difference (I tried it too with Numpy 1.6.1 on an x86_64 Linux architecture and got the same bug).<br>If you want to use an official Numpy release you'll probably need to downgrade to 1.5.x and wait until the next Numpy release.<br>
<br>-=- Olivier<br><br><div class="gmail_quote">2011/9/20 Aditya Sethi <span dir="ltr"><<a href="mailto:ady.sethi@gmail.com">ady.sethi@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hi,<div><br></div><div>Stefan, which version of Python and NumPy are you using?</div><div><br></div><div>I am upgrading Python and NumPy, and would like to get it working on the official releases of Python 2.7.2 + NumPy 1.6.1</div>

<div><br></div><div>In Python 2.6 + NumPy 1.5.1 on win32, it works.</div><div>In Python 2.7.2 + NumPy 1.6.1 on win32, np.frompyfunc(add,2,1).accumulate definitely gives an error.</div><div><br></div><div><div>Python 2.7.2 (default, Jun 12 2011, 15:08:59) [MSC v.1500 32 bit (Intel)] on win32</div>

<div>Type "help", "copyright", "credits" or "license" for more information.</div><div>>>> import numpy as np</div><div>>>> def add(a,b):</div><div>...     return (a+b)</div>

<div>...</div><div>>>> uadd = np.frompyfunc(add,2,1)</div><div>>>> uadd</div><div><ufunc 'add (vectorized)'></div><div>>>> uadd([1,2,3],[1,2,3])</div><div>array([2, 4, 6], dtype=object)</div>

<div>>>></div><div>>>> uadd.accumulate([1,2,3])</div><div>Traceback (most recent call last):</div><div>  File "<stdin>", line 1, in <module></div><div>ValueError: could not find a matching type for add (vectorized).accumulate, requested type has type code 'l'</div>

<div>>>></div></div><div><br></div><div>Aditya</div><div><br></div><div><br><div class="gmail_quote">2011/9/19 Stéfan van der Walt <span dir="ltr"><<a href="mailto:stefan@sun.ac.za" target="_blank">stefan@sun.ac.za</a>></span><br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>On Mon, Sep 19, 2011 at 4:18 PM, Aditya Sethi <<a href="mailto:ady.sethi@gmail.com" target="_blank">ady.sethi@gmail.com</a>> wrote:<br>


> But uadd.accumulate(..) or uadd.reduce(..) fail with error:<br>
>  ValueError: could not find a matching type for add (vectorized).accumulate<br>
> ( or (vectorized).reduce )<br>
> Apologies, I should have been more clear before.<br>
<br>
</div>In the development version:<br>
<br>
In [4]: uadd.accumulate([1,2,3])<br>
Out[4]: array([1, 3, 6], dtype=object)<br>
<br>
In [5]: uadd.reduce([1,2,3])<br>
Out[5]: 6<br>
<br>
Regards<br>
<div><div></div><div>Stéfan<br>
_______________________________________________<br>
NumPy-Discussion mailing list<br>
<a href="mailto:NumPy-Discussion@scipy.org" target="_blank">NumPy-Discussion@scipy.org</a><br>
<a href="http://mail.scipy.org/mailman/listinfo/numpy-discussion" target="_blank">http://mail.scipy.org/mailman/listinfo/numpy-discussion</a><br>
</div></div></blockquote></div><br></div>
<br>_______________________________________________<br>
NumPy-Discussion mailing list<br>
<a href="mailto:NumPy-Discussion@scipy.org">NumPy-Discussion@scipy.org</a><br>
<a href="http://mail.scipy.org/mailman/listinfo/numpy-discussion" target="_blank">http://mail.scipy.org/mailman/listinfo/numpy-discussion</a><br>
<br></blockquote></div><br>