假设列名为
显然,按相关性排序应该是:
A,B,C
等。显然,按相关性排序应该是:
ix = df.corr().sort_values('A', ascending=False).index
df_sorted = df.loc[:, ix]
如果我想按绝对相关性排序怎么办?