خرید بک لینک

Vote count: 0

I have 6 arrays, let's say a,b,c1,d1,c2,d2.

Arrays a and b have some common pairs of c1,c2 and d1,d2. I find these common pairs, i.e. those a and b which have the same c1,d1 and c2,d2 like this:

data_zcosmo_lastz = a
data_zphot_lastz = b
halo_id_zcosmo = c1 
halo_id_zphot = c2
idrep_zcosmo = d1
idrep_zphot = d2


file2freq1 = Counter(zip(c1,d1))
file2freq2 = Counter(zip(c2,d2))

set_a = set(file2freq1) & set(file2freq2) # common objects  

The above code gives set_a to have those common values of c1,d1 and c2,d2.

But how do I get the values of a and b of set_a?

i.e. I want the a and b values of set_a.

Example

a = [1,2,3,4,5]
b = [2,3,4,5,6]
c1 = [1,1,1,2,2]
d1 = [3,3,3,4,4]
c2 = [1,1,2,2,2]
d2 = [3,3,1,4,4]

so set_a = [(1,3),(1,3),(2,4),(2,4)].

asked 3 mins ago

برچسب: نویسنده: استخدام کار تاريخ: سه شنبه 25 اسفند 1394 ساعت: 22:44

صفحه بندی