Skip to content

Instantly share code, notes, and snippets.

@kzinmr
Created August 3, 2020 10:16
Show Gist options
  • Save kzinmr/cbdc45c7b5721ecae3eec362f9454533 to your computer and use it in GitHub Desktop.
Save kzinmr/cbdc45c7b5721ecae3eec362f9454533 to your computer and use it in GitHub Desktop.
def detect_corr(df):
c = df.corr(method='pearson').abs()
s = c.unstack().apply(lambda x: 0 if x==1 else x)
so = s.sort_values(kind="quicksort")[::-1]
return so
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment