Re: Fastest way to max() list

2008-09-29 Thread Gabriel Genellina
En Fri, 26 Sep 2008 01:42:59 -0300, Chris Rebert <[EMAIL PROTECTED]> escribió: B. Assuming by "distance" you meant "difference" and/or that the distance is only in 1 dimension: from operator import itemgetter firsts = map(itemgetter(0), main_list) distance = max(firsts) - min(firsts) I thin

Re: Fastest way to max() list

2008-09-26 Thread David Di Biase
Yeah, Apologies, it's been a long day for me. It works, just have to check if the nazis I'm doing this for will allow me to use object and NumPy. ack. Thanks again, Dave On Fri, Sep 26, 2008 at 2:08 PM, Chris Rebert <[EMAIL PROTECTED]> wrote: > On Fri, Sep 26, 2008 at 7:22 AM, David Di Biase <

Re: Fastest way to max() list

2008-09-26 Thread Chris Rebert
On Fri, Sep 26, 2008 at 7:22 AM, David Di Biase <[EMAIL PROTECTED]> wrote: > Hi Chris, > > Yeah I hear you on point A. but this the specification I was given, so I > have to follow it unfortunately. I've also been restricted and not allowed > to use any other packages. I was using NumPy earlier (sh

Re: Fastest way to max() list

2008-09-26 Thread David Di Biase
Hi Chris, Yeah I hear you on point A. but this the specification I was given, so I have to follow it unfortunately. I've also been restricted and not allowed to use any other packages. I was using NumPy earlier (should have mentioned that) but I was wondering if there was a simpler way. Is NumPy t

Re: Fastest way to max() list

2008-09-25 Thread Chris Rebert
On Thu, Sep 25, 2008 at 8:57 PM, David Di Biase <[EMAIL PROTECTED]> wrote: > I have a list with about 1000-1500 sub-lists which look like so: > list[-0.28817955213290786, 3.6693631467403929, 'H', 31.31225233035784]] > > The first and second values are Angstrom units specifying the location of a > p

Fastest way to max() list

2008-09-25 Thread David Di Biase
I have a list with about 1000-1500 sub-lists which look like so: list[-0.28817955213290786, 3.6693631467403929, 'H', 31.31225233035784]] The first and second values are Angstrom units specifying the location of a particle. What I'd like to do is determine the distance between the smallest and larg