Created
November 21, 2019 05:19
-
-
Save kperry2215/f66ca97dab1cc9481b07a10fb59f07ae 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
def mann_whitney_u_test(distribution_1, distribution_2): | |
""" | |
Perform the Mann-Whitney U Test, comparing two different distributions. | |
Args: | |
distribution_1: List. | |
distribution_2: List. | |
Outputs: | |
u_statistic: Float. U statisitic for the test. | |
p_value: Float. | |
""" | |
u_statistic, p_value = stats.mannwhitneyu(distribution_1, distribution_2) | |
return u_statistic, p_value | |
#### MAIN FUNCTION #### | |
#Perform the Mann-Whitney U Test on the two distributions | |
mann_whitney_u_test(list(df_less_than_50k['age']), list(df_greater_than_50k['age'])) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment