Skip to content

Instantly share code, notes, and snippets.

@peter-jung
Created February 23, 2017 07:06
Show Gist options
  • Save peter-jung/628af02537a23fd706477d891b89c106 to your computer and use it in GitHub Desktop.
Save peter-jung/628af02537a23fd706477d891b89c106 to your computer and use it in GitHub Desktop.
check your intuition: when x is evenly distributed around 0, and x^2 are totally uncorrelated
'''
check your intuition: when x is evenly distributed around 0, and x^2 are totally uncorrelated
'''
import pandas as pd
import numpy as np
x = np.random.normal(0,1,1000)
y = x**2
df = pd.DataFrame({'x':x,'y':y})
print df.corr()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment