2016-11-15 41 views
0

我有與含有ID數據的每一行和幾個二進制數據僅具有兩個選擇0或1如何在python中繪製單個繪圖中的幾個分類特徵?

ID,FEAT1,FEAT2,feat3一個熊貓數據幀,feat4
AA,0,1, 1,0
AB,1,0,1,0
交流,0,0,1,0

和等

我希望能夠在y軸與ID想象這一點,以及x軸上的所有特徵...,其中點代表1而沒有代表0的點幾乎與上面的數據幀類似,但是以圖形形式

回答

1

您可以考慮heatmap

import seaborn as sns 
ax = sns.heatmap(df.set_index('id'), annot = True) 

enter image description here