469,282 Members | 2,000 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,282 developers. It's quick & easy.

Set operations in Numeric

Is there a way to handle numeric (or numarray or numpy) arrays as sets
and compute efficiently their intersection, union, etc. ? I hope there
is a faster way than s = array(set(A) & set(B)). Can this be done with
masked arrays maybe ? I've never used them though and browsing through
the docs didn't make clear if it is possible.

Thanks,
George

Oct 23 '06 #1
2 1040
George Sakkis wrote:
Is there a way to handle numeric (or numarray or numpy) arrays as sets
and compute efficiently their intersection, union, etc. ? I hope there
is a faster way than s = array(set(A) & set(B)). Can this be done with
masked arrays maybe ? I've never used them though and browsing through
the docs didn't make clear if it is possible.
You'll probably want to ask such questions on the numpy list:

http://www.scipy.org/Mailing_Lists

Robert Cimrman has implemented a number of set operations based on sorting.

http://svn.scipy.org/svn/scipy/trunk...arraysetops.py

--
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
that is made terrible by our own mad attempt to interpret it as though it had
an underlying truth."
-- Umberto Eco

Oct 23 '06 #2
Robert Kern wrote:
George Sakkis wrote:
Is there a way to handle numeric (or numarray or numpy) arrays as sets
and compute efficiently their intersection, union, etc. ? I hope there
is a faster way than s = array(set(A) & set(B)). Can this be done with
masked arrays maybe ? I've never used them though and browsing through
the docs didn't make clear if it is possible.

You'll probably want to ask such questions on the numpy list:

http://www.scipy.org/Mailing_Lists

Robert Cimrman has implemented a number of set operations based on sorting.

http://svn.scipy.org/svn/scipy/trunk...arraysetops.py
Thank you so much, these fit the bill perfectly !

George

Oct 23 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Travis Oliphant | last post: by
2 posts views Thread by Johannes Nix |Johannes.Nix | last post: by
8 posts views Thread by Fabrício de Novaes Kucinskis | last post: by
8 posts views Thread by Sam Fisher | last post: by
reply views Thread by robert | last post: by
7 posts views Thread by Flavio | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.