Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #28756
| References | <c44aff41-71ed-4323-9184-9c87bd0e1119@googlegroups.com> <60A480B7378343149401A424A682AF34@gmail.com> <CAE5RzXmmGF-w0qHG1F6J5yBMMUptzmGmTqpjh21gf8Yg0A1U_w@mail.gmail.com> <C6FCB83691994615873009528A6C0CD7@gmail.com> <CAE5RzXnjE+UqZj5Ofk2i0F=9U7ZGaAi2D+odwZbUHz0_bYQbzg@mail.gmail.com> |
|---|---|
| Date | 2012-09-09 16:32 +1000 |
| Subject | Re: Is there a unique method in python to unique a list? |
| From | Chris Angelico <rosuav@gmail.com> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.405.1347172371.27098.python-list@python.org> (permalink) |
On Sun, Sep 9, 2012 at 4:29 PM, John H. Li <typetoken@gmail.com> wrote: > However, if I don't put list(set(lemma_list)) to a variable name, it works > much faster. Try backdenting that statement. You're currently doing it at every iteration of the loop - that's why it's so much slower. But you'll probably find it better to work with the set directly, instead of uniquifying a list as a separate operation. ChrisA
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Is there a unique method in python to unique a list? Token Type <typetoken@gmail.com> - 2012-09-08 22:43 -0700
Re: Is there a unique method in python to unique a list? Chris Angelico <rosuav@gmail.com> - 2012-09-09 15:48 +1000
Re: Is there a unique method in python to unique a list? Chris Angelico <rosuav@gmail.com> - 2012-09-09 16:32 +1000
Re: Is there a unique method in python to unique a list? Token Type <typetoken@gmail.com> - 2012-09-08 23:44 -0700
Re: Is there a unique method in python to unique a list? Paul Rubin <no.email@nospam.invalid> - 2012-09-09 01:41 -0700
Re: Is there a unique method in python to unique a list? Paul Rubin <no.email@nospam.invalid> - 2012-09-09 02:06 -0700
Re: Is there a unique method in python to unique a list? Token Type <typetoken@gmail.com> - 2012-09-09 06:44 -0700
Re: Is there a unique method in python to unique a list? Chris Angelico <rosuav@gmail.com> - 2012-09-10 00:13 +1000
Re: Is there a unique method in python to unique a list? Serhiy Storchaka <storchaka@gmail.com> - 2012-09-09 11:36 +0300
csiph-web