Style questions

2008-10-23 Thread David Di Biase
I have a few simple questions regarding python style standards. I have a class contained in a module...I'm wondering if I should perform any imports that are relevant to the class within the constructor of the class or at the top of the module page. Also if I'm creating a docstring for the class I

Re: Fun with reverse sorts

2008-10-02 Thread David Di Biase
the same way... Ok problem resolved. Grazie tanto ;-) David On Fri, Oct 3, 2008 at 12:08 AM, Chris Rebert <[EMAIL PROTECTED]> wrote: > On Thu, Oct 2, 2008 at 8:07 PM, David Di Biase <[EMAIL PROTECTED]> > wrote: > > Hi there, > > > > I'm sorting an expansive li

Fun with reverse sorts

2008-10-02 Thread David Di Biase
Hi there, I'm sorting an expansive list descending according to a list of tuples. Basically it has to sort the last value in the tuple (3) but if they are the same then it should resort to using the second last value (2). Now according to my very limited testing I've somewhat figured out that this

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

Re: Fastest way to max() list

2008-09-26 Thread David Di Biase
12:42 AM, Chris Rebert <[EMAIL PROTECTED]> wrote: > 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.3

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

Re: Schwartzian transform for tuple in list

2008-09-24 Thread David Di Biase
When you say slightly, is it enough to make a difference? Why would getitems be faster even - not sure I can think why... Sent from my iPhone On 24-Sep-08, at 5:46 PM, Matt Nordhoff <[EMAIL PROTECTED]> wrote: Chris Rebert wrote: On Wed, Sep 24, 2008 at 2:02 PM, David Di Biase &

Schwartzian transform for tuple in list

2008-09-24 Thread David Di Biase
Hi, I have a rather large list structure with tuples contained in them (it's part of a specification I received) looks like so: [(x1,y1,r1,d1),(x2,y2,r2,d2)...] The list can range from about 800-1500 tuples in size and I'm currently sorting it with this: a_list.sort(lambda a, b: cmp(b[3], a[3]))