📜  查找最高相关性对 pandas - Python 代码示例

📅  最后修改于: 2022-03-11 14:46:04.040000             🧑  作者: Mango

代码示例1
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]