[SciPy-user] Array selection help
Jose Gomez-Dans
jgomezdans at gmail.com
Wed Feb 11 12:31:44 EST 2009
Josef,
Thanks for that
2009/2/11 <josef.pktd at gmail.com>
> list comprehension is still a bit faster. That's about 90 times faster
> than your version for building the dict of indices for this case.
I still think ndimage is more obvious to use if you have images, and in my
case it is fast (I didn't time it, but less than making a cup of horrible
instant coffee ;p). My problem is that it takes a long time to go from a
list/dictionary of class mean values (output from either Stéfan's ndimage
solution or your dictionary solution) back into the original 2D array.
In fact, I'm thinking about using weave to achieve this, unless someone
comes up with a better idea.
Many thanks for your help, and for the code!
Jose
--
Remote Sensing Unit | Env. Monitoring and Modelling Group
Dept. of Geography | Dept. of Geography
University College London | King's College London
Gower St, London WC1E 6BT UK | Strand Campus, Strand, London WC2R 2LS UK
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.scipy.org/pipermail/scipy-user/attachments/20090211/87b95fb6/attachment.html>
More information about the SciPy-User
mailing list