Andrea Gavana <andrea.gavana <at> gmail.com> writes: > this should be a very easy question but I am trying to make a > script run as fast as possible, so please bear with me if the solution > is easy and I just overlooked it.
That's weird, I was trying to solve exactly the same problem a couple of weeks ago for a program I was working on. It must come up a lot. I ended up with a similar solution to Josef's, but it took me more than an hour to work it out - I should have asked here first! Neil _______________________________________________ Numpy-discussion mailing list Numpy-discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion