text_html_output_1.png
from scipy.stats import pearsonr

import pandas as pd

import seaborn as sns

def getCorr(x, y):
    corr, _ = pearsonr(x, y)
    return corr

dftrain = pd.read_csv('../input/dont-overfit-ii/train.csv')
dftest = pd.read_csv('../input/dont-overfit-ii/test.csv')

y=sns.regplot(x='1',y='target',data=dftrain)

L = []
for feature in range(300):
    y = sns.regplot(x=str(feature), y='target', data=dftrain)
    L.append({'feature': feature, 'slope': getCorr(dftrain['target'], dftrain[str(feature)])})