Skip to content

Instantly share code, notes, and snippets.

@PranjalDureja0002
Created March 2, 2021 10:08
Show Gist options
  • Save PranjalDureja0002/424d9a1ee85aaefc59f1abdc98caabc8 to your computer and use it in GitHub Desktop.
Save PranjalDureja0002/424d9a1ee85aaefc59f1abdc98caabc8 to your computer and use it in GitHub Desktop.
eda
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