# ==  Basic import == #
# plot within the notebook
%matplotlib inline
# No annoying warnings
import warnings
warnings.filterwarnings('ignore')

import numpy as np

x = np.random.rand(200)
y = np.random.rand(200)

"""
Explanation: Let's draw non-correlated values
The values are independently drawn from uniform random distributions
End of explanation
"""


import matplotlib.pyplot as mpl
mpl.plot(x,y, ls="None",marker="s",ms=15, mfc="None")

"""
Explanation: See how it looks like
End of explanation
"""


z = x*3 + np.random.normal(0,scale=0.3,size=200)

mpl.plot(x,z, ls="None",marker="s",ms=15, mfc="None")

"""
Explanation: Now let's create a variable that depends on x "z" plus some other random distribution (noise or other dependency)
End of explanation
"""


from scipy import stats

"""
Explanation: And measure the Pearson Correlation coefficient
End of explanation
"""


stats.pearsonr(x,y)

stats.pearsonr(x,z)

"""
Explanation: First value rho, second p-value (see future lesson)
End of explanation
"""


