On 04/03/2008, Pierre GM <[EMAIL PROTECTED]> wrote: > Anne, > > Thanks a lot for your suggestion. Something like > > >>>if axis is None: > >>> return b.flat[a.argmin()] > >>>else: > >>> return numpy.choose(a.argmin(axis),numpy.rollaxis(b,axis,0)) > > seems to do the trick fairly nicely indeed. The other solutions you suggested > would require too much ad hoc adaptation. > Thanks again !
Ah! "It ain't the things you don't know that'll get you, it's the things you know that ain't so." I thought rollaxis rolled the axes around cyclically. This is much more useful, but what a funny name for what it actually does... I should have provided the link before, but this is very useful for answering this kind of question: http://www.scipy.org/Numpy_Functions_by_Category Good luck, Anne _______________________________________________ Numpy-discussion mailing list [email protected] http://projects.scipy.org/mailman/listinfo/numpy-discussion
