Le 5 avril 2012 11:45, Neal Becker <ndbeck...@gmail.com> a écrit :

> Adam Hughes wrote:
>
> > If you are storing objects, then can't you store them in a list and just
> do:
> >
> > for obj in objectlist:
> >      obj.attribute = value
> >
> > Or am I misunderstanding?
> >
>
> It's multi-dimensional, and I wanted to avoid writing explicit loops.
>

You can do:

f = numpy.frompyfunc(lambda x: x.some_attribute == 0, 1, 1)

Then
f(array_of_objects_x)

-=- Olivier
_______________________________________________
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to