使用熊猫和情节进行相关

时间:2017-05-30 19:15:53

标签: python pandas

let selectedCity = Cities.ny
myFunc(city : selectedCity)

如何使用pandas将fdr_old与fdr_new关联起来并得到像这样的情节enter image description here

感谢

编辑:

或类似的东西。 enter image description here

1 个答案:

答案 0 :(得分:6)

像这样?

In [45]: import seaborn as sns

In [46]: sns.lmplot(x='fdr_old', y='fdr_new', data=df)
Out[46]: <seaborn.axisgrid.FacetGrid at 0xbb8b470>

结果:

enter image description here

UPDATE:两列之间的相关性:

In [47]: df.filter(like='fdr').corr()
Out[47]:
          fdr_new   fdr_old
fdr_new  1.000000  0.551083
fdr_old  0.551083  1.000000