Selecting unique values

Dan Stromberg drsalists at gmail.com
Tue Jul 26 21:38:40 CEST 2011


Some good stuff has already been suggested.  Another possibility is using a
treap (not a duptreap but a treap):

http://stromberg.dnsalias.org/~dstromberg/treap/

If you just need things unique'd once, the set + yield is an excellent
option.  If you need to keep things in order, but also need to make changes
now and then, the treap is very good.

On Mon, Jul 25, 2011 at 3:03 PM, Kumar Mainali <kpmainali at utexas.edu> wrote:

> Greetings
>
> I have a dataset with occurrence records of multiple species. I need to get
> rid of multiple listings of the same occurrence point for a species (as you
> see below in red and blue typeface). How do I create a dataset only with
> unique set of longitude and latitude for each species? Thanks in advance.
>
> Species_name Longitude Latitude
> Abies concolor -106.601 35.868
> Abies concolor -106.493 35.9682
> Abies concolor -106.489 35.892
> Abies concolor -106.496 35.8542
> Accipiter cooperi -119.688 34.4339
> Accipiter cooperi -119.792 34.5069
> Accipiter cooperi -118.797 34.2581
> Accipiter cooperi -77.38333 39.68333
> Accipiter cooperi -77.38333 39.68333
> Accipiter cooperi -75.99153 40.633335
> Accipiter cooperi -75.99153 40.633335
>
> - Kumar
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20110726/0f9c8e4a/attachment.html>


More information about the Python-list mailing list