import statistics def corel(lst1, lst2): n=min(len(lst1), len(lst2)) lst1=lst1[:n] lst2=lst2[:n] res=statistics.correlation(lst1, lst2) return res