# Import those libraries from scipy.stats import pearsonr # Apply the pearsonr() corr, _ = pearsonr(list1, list2) print('Pearsons correlation: %.3f' % corr) # This code is contributed by Amiya Rout