Created
November 21, 2019 05:18
-
-
Save kperry2215/a1541588129d41bf849e6fe4f6d04b8b to your computer and use it in GitHub Desktop.
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
#Subset the data into salary categories | |
df_less_than_50k = df[df['salary'] == ' <=50K'] | |
df_greater_than_50k = df[df['salary'] == ' >50K'] | |
#Plot the histogram for the distribution for data <=$50K | |
generate_distribution_histogram(df_less_than_50k, 'age', | |
title = 'Age Distribution: US Population', | |
x_axis_label = 'Age (years)', | |
y_axis_label = 'Frequency', | |
label_name = '<=$50K') | |
#Plot the histogram for the distribution for data >$50K | |
generate_distribution_histogram(df_greater_than_50k, 'age', | |
title = 'Age Distribution: US Population', | |
x_axis_label = 'Age (years)', | |
y_axis_label = 'Frequency', | |
label_name = '>$50K') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment