Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

find highest correlation pairs pandas

import pandas as pd
import numpy as np

shape = (50, 4460)

data = np.random.normal(size=shape)

data[:, 1000] += data[:, 2000]

df = pd.DataFrame(data)

c = df.corr().abs()

s = c.unstack()
so = s.sort_values(kind="quicksort")

print so[-4470:-4460]
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #find #highest #correlation #pairs #pandas
ADD COMMENT
Topic
Name
2+6 =