Skip to content

Instantly share code, notes, and snippets.

@PranjalDureja0002
Created March 1, 2021 12:03
Show Gist options
  • Save PranjalDureja0002/7ea84899460d93f4328fd470a88fb5bf to your computer and use it in GitHub Desktop.
Save PranjalDureja0002/7ea84899460d93f4328fd470a88fb5bf to your computer and use it in GitHub Desktop.
Health_Fraud
colors_list = ['#5bc0de','#d9534f']
plt.title("Potential Fraud distribution")
ax = patient_data['PotentialFraud'].value_counts().plot(kind='bar', figsize=(5,5), width=0.8,color = colors_list)
total = len(patient_data['PotentialFraud'])
for p in ax.patches:
percentage = '{:.1f}%'.format(100 * p.get_height()/total)
x = p.get_x() + p.get_width() - 0.5
y = p.get_y() + p.get_height()
ax.annotate(percentage, (x, y))
plt.xlabel('Potential_Fraud')
plt.ylabel('Count')
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment