Answers for "find highest correlation pairs pandas"

0

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]
Posted by: Guest on September-16-2020

Code answers related to "find highest correlation pairs pandas"

Python Answers by Framework

Browse Popular Code Answers by Language