Hs = [0.5, 1.0, 2.3, 0.5, 0.5]
Tm = [2.0, 2.5, 2.0, 2.0, 3.0]
occurrences = Counter(zip(Hs, Tm))
for h in sorted(set(Hs)):
    for t in sorted(set(Tm)):
        pass
How to count how many times a pair of specific values ​​are repeated in an array?