how to compare two fields in python

Fábio Santos fabiosantosart at gmail.com
Tue Apr 30 14:42:35 EDT 2013


> The data was sorted and so duplicates will not appear anywhere in the
dataframe.
>

I guess that's it. Use the standard csv module and itertools.groupby.
Groupby will produce a list of grouped objects. So you can group by the
first column by supplying a key function which just returns the first
column.

Check this out for an example:
http://stackoverflow.com/questions/773/how-do-i-use-pythons-itertools-groupby(most
upvoted answer)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20130430/ff488240/attachment.html>


More information about the Python-list mailing list