Hi,

Stefan, which version of Python and NumPy are you using?

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

In Python 2.6 + NumPy 1.5.1 on win32, it works.
In Python 2.7.2 + NumPy 1.6.1 on win32, np.frompyfunc(add,2,1).accumulate definitely gives an error.

Python 2.7.2 (default, Jun 12 2011, 15:08:59) [MSC v.1500 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy as np
>>> def add(a,b):
...     return (a+b)
...
>>> uadd = np.frompyfunc(add,2,1)
>>> uadd
<ufunc 'add (vectorized)'>
>>> uadd([1,2,3],[1,2,3])
array([2, 4, 6], dtype=object)
>>>
>>> uadd.accumulate([1,2,3])
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: could not find a matching type for add (vectorized).accumulate, requested type has type code 'l'
>>>

Aditya


2011/9/19 Stéfan van der Walt <stefan@sun.ac.za>
On Mon, Sep 19, 2011 at 4:18 PM, Aditya Sethi <ady.sethi@gmail.com> wrote:
> But uadd.accumulate(..) or uadd.reduce(..) fail with error:
>  ValueError: could not find a matching type for add (vectorized).accumulate
> ( or (vectorized).reduce )
> Apologies, I should have been more clear before.

In the development version:

In [4]: uadd.accumulate([1,2,3])
Out[4]: array([1, 3, 6], dtype=object)

In [5]: uadd.reduce([1,2,3])
Out[5]: 6

Regards
Stéfan
_______________________________________________
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion