comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » all combinations from two lists
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
all combinations from two lists [message #75652] Mon, 14 March 2011 12:40
Jeremy Bailin is currently offline  Jeremy Bailin
Messages: 618
Registered: April 2008
Senior Member
I'm sure this is possible using some variant of JD's histogram-of-histogram approach, but I'm getting very bogged down in the details, so maybe someone can disentangle it.

I have two lists of IDs. I would like a list of every time an ID appears in both lists. But each ID can appear multiple times in each list, and I would like all combinations. For example:

list1 = [0,1,4,7,8,4,7,4,9]
list2 = [0,6,8,4,4,9,10]

I would like an output list that contains:
0 0 (indices of "0" in both)
2 3
2 4
5 3
5 4
7 3
7 4 (all permutations of where "4" appears in both)
4 2 (indices of "8" in both)
8 5 (indices of "9" in both)

Each list contains millions of elements, so it shouldn't loop through elements or IDs.

-Jeremy.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Earth Symbol
Next Topic: Re: all combinations from two lists

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 13:42:37 PDT 2025

Total time taken to generate the page: 0.00451 seconds