Skip to content

Instantly share code, notes, and snippets.

@wibowotangara
Created January 23, 2024 09:28
Show Gist options
  • Save wibowotangara/fff75f140179cab432891b535dc910a6 to your computer and use it in GitHub Desktop.
Save wibowotangara/fff75f140179cab432891b535dc910a6 to your computer and use it in GitHub Desktop.
loan_category_counts = X_train['loan_label'].value_counts()
colors = ['green', 'red']
plt.bar(loan_category_counts.index, loan_category_counts.values, color=colors)
plt.xlabel('Loan Label')
plt.ylabel('Count')
plt.title('Distribution of Loan Label')
for i, count in enumerate(loan_category_counts.values):
plt.text(i, count, str(count), ha='center', va='bottom', fontsize=10)
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment