Created
July 14, 2020 12:18
-
-
Save bibscy/5aa0d1cba753773bb88d1929a819309e to your computer and use it in GitHub Desktop.
This file contains 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
#check total number of males | |
totalMales = newDF.loc[(newDF.Gender=='Male')].count() #409 | |
print("totalMales" + str(totalMales)) | |
totalFemales = newDF.loc[(newDF.Gender=='Female')].count() #77 | |
print("totalFemales" + str(totalFemales)) | |
#males are more likely to borrow than females 409 > 77 | |
plt.style.use('ggplot') | |
x = ['Males', 'Females'] | |
y = [totalMales, totalFemales] | |
x_pos = [i for i, _ in enumerate(x)] | |
plt.bar(x_pos, y, color='green') | |
plt.xlabel("Gender") | |
plt.ylabel("Total who Paid Off") | |
plt.title("Number of Males vs Females who Paid Off") | |
plt.xticks(x_pos, x) | |
plt.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment