[SciPy-user] Array selection help
Wed Feb 11 11:31:44 CST 2009
Thanks for that
> 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!
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...
More information about the SciPy-user