Created
March 15, 2021 09:25
-
-
Save PranjalDureja0002/ceb93a25260f084f99aa73035e2facc8 to your computer and use it in GitHub Desktop.
data
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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