我在执行下面的代码后收到了这个条形图Please click here。但是在我的栏顶部,每个值都由value.0表示。我只是想问我怎么能删除.0。我是熊猫的初学者,我很感激任何帮助。谢谢 。
df=pd.DataFrame([11,62,82,120,125,141,192,38],index = ['10-20','21-30','31-40','41-50','51-60','61-70','71-80','81-90'])
ax = df.plot(kind='bar',stacked = False, colormap = 'Paired',alpha=0.75, rot=0)
ax.legend_.remove()
for p in ax.patches:
ax.annotate(np.round(p.get_height(),decimals=0), (p.get_x()+p.get_width()/2., p.get_height()), ha='center', va='center', xytext=(2, 10), textcoords='offset points')
plt.ylabel('Number of co-occurrences ')
plt.title('Occurences by Age Group')
plt.show()