I have this:
list = [
(('hash1', 'hash2'), (436, 1403)),
(('hash1', 'hash2'), (299, 1282)),
(('hash2', 'hash3'), (1244, 30)),
(('hash1', 'hash3'), (436, 1403)),
(('hash3', 'hash4'), (299, 1282)),
(('hash5', 'hash4'), (1244, 30)),
]
I need to count how many occurrences are for the 1st couple
So I do this:
out = Counter((x[0]) for x in list)
OUTPUT:
Counter({('hash1', 'hash2'): 2, ('hash2', 'hash3'): 1, ('hash1', 'hash3'): 1, ('hash3', 'hash4'): 1, ('hash5', 'hash4'): 1})
And it's okay, but the result I want is this:
'hash1','hash2,(436,1403)
I need the second value to, that can be random so in this case can be
(436, 1403) or `(299, 1282))`
EXPECTED OUTPUT:
Couple of hash, any couple of number of the hash1,hash2, N.occurrences
((hash1,hash2),(436,1403),2
There is a way to do this?