绘制并比较两个排名

时间:2019-02-19 07:26:23

标签: python coordinates

我有两个变量重要性排名,我想比较每个变量在Y轴上的增减情况,在Z轴和X轴上的排名只有两个值R1和{{ 1}}

创建虚拟数据集:

R2

到目前为止-

import pandas
import matplotlib.pyplot as plt
from pandas.tools.plotting import parallel_coordinates
df=pd.DataFrame({'var':['x','y','z','a','b','c'],
                 'rank_1':[1,2,3,4,5,6],
                'rank_2':[1,4,2,5,3,6]})
df['diff']=df['rank_1']-df['rank_2']
df['impact']=np.where(df['diff']<0,"Decrease",np.where(df['diff']==0,"Same","Increase"))
df

如何在与Y轴相反的另一个Z轴上获取变量名(变量列)?

0 个答案:

没有答案