import numpy as np # Calculate Pearson correlation coefficient between two variables x = [1, 2, 3, 4] y = [2, 3, 4, 5] # Numpy corrcoef function to calculate the Pearson correlation coefficient and p-value pearson_corr = np.corrcoef(x, y)[0][1] # Print the result print("Pearson Correlation between the given two variables: " + \ str(pearson_corr))