[Numpy-discussion] Using objects in arrays

Travis Oliphant oliphant at ee.byu.edu
Tue Dec 4 10:05:02 EST 2001

> I am trying to use objects in an array, and still be able to use the
> various extra functions offered by multiarray.  I am finding that some
> of the functions work and some don't.  Is it hopeless to try to use
> objects in an array and expect <op>.reduce and others to work
> properly?
> As a simple example, I have a DataPoint object that consists of a
> value and flag(s).  This object has all the __cmp__, __add_, etc
> functions implemented.
> I can do MA.average(m), MA.sum(m), MA.add.reduce(m), (they
> seem to use __add__) but I can't do MA.minimum.reduce(m) or
> MA.maximum.reduce(m).

This is actually, very helpful information.  I'm not sure how well-tested
the object-type is with Numeric.  I know it has been used, but I'm not
sure all of the ufunc methods have been well tested.

However, I'm not sure what is caused by MA and what is caused by basic
Numeric, however.


More information about the NumPy-Discussion mailing list