removing duplication from a huge list.

Chris Rebert clp2 at
Fri Feb 27 06:15:39 CET 2009

On Thu, Feb 26, 2009 at 8:49 PM, Benjamin Peterson <benjamin at> wrote:
> Shanmuga Rajan <m.shanmugarajan <at>> writes:
>> f any one suggests better solution then i will be very happy.Advance thanks
> for any help.Shan
> Use a set.

To expand on that a bit:

counted_recs = set(rec[0] for rec in some_fun())
#or in Python 3.0:
counted_recs = {rec[0] for rec in some_fun()}


Follow the path of the Iguana...

More information about the Python-list mailing list