import statistics def mod2(list1, list2): n = min(len(list1), len(list2)) if n == 0: return 0.0 x = list1[:n] y = list2[:n] cor = statistics.correlation(x, y) return cor