473,385 Members | 1,620 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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 1140
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Travis Oliphant | last post by:
Numarray is making great progress and is quite usable for many purposes. An idea that was championed by some is that the Numeric code base would stay static and be replaced entirely by Numarray. ...
2
by: Johannes Nix |Johannes.Nix | last post by:
Hi, I have a tricky problem with Numeric. Some time ago, I have generated a huge and complex data structure, and stored it using the cPickle module. Now I want to evaluate it quickly again on a...
8
by: Fabrício de Novaes Kucinskis | last post by:
Hi all, I'm doing some bitwise operations in VB.NET, and I got some strange results. If an Int16 (Short) variable has the value &HAA (8 bits) and I do a 4-bit shift: var16 = var16 << 4 I...
8
by: Sam Fisher | last post by:
Hi, I have a situation where I have to support a large number(not decimals), something of the order of 20 to 30 digits in the database(sql server 2000) I am not able to use LONG data type as it...
10
by: Emilio | last post by:
Do I use 'or' for bitwise operations where in c# I use | ?
6
by: Devrim GUNDUZ | last post by:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi, We were performing some tests on PostgreSQL and found that it fails on the following query: SELECT 512*18014398509481984 AS result;
0
by: robert | last post by:
just a note - some speed comparisons : 0.60627370238398726 0.42836673376223189 0.36965815487747022 0.016557970357098384 0.15692469294117473 0.01951756438393204
5
by: newbie | last post by:
table `user` --------------------------------------- | id | user_name | gender | --------------------------------------- I can gurantee that ids in table user are unique (so each number...
7
by: Flavio | last post by:
Hi, I have been playing with set operations lately and came across a kind of surprising result given that it is not mentioned in the standard Python tutorial: with python sets, intersections ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.