如何在条形图上标记警报计数

时间:2019-06-25 17:30:37

标签: python data-visualization

如何使用mathplotlib或seaborn在条形图上显示标签计数

aap_wise_group_alert.plot(x='Apps/service' , y='AlertCount', kind="barh")

#Filter the Apps/Service data and store in new dataframe
app_wise= df.filter(['Time received','Apps/Service'], axis=1)

app_wise= app_wise.dropna()
#Grouping the columns app_wise
aap_wise_group= app_wise.groupby('Apps/Service')['Time received'].nunique()
aap_wise_group= aap_wise_group.to_frame()
aap_wise_group['Apps/service']=aap_wise_group.index
aap_wise_group=aap_wise_group.reset_index(drop=True)
aap_wise_group.rename(columns={'Time received' : 'AlertCount'}, inplace=True)
aap_wise_group_alert = aap_wise_group.loc[(aap_wise_group['AlertCount'] >=500)]
aap_wise_group_alert.plot(x='Apps/service' , y='AlertCount', kind="barh")

0 个答案:

没有答案