In [1]:
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
%matplotlib inline
city_data = pd.read_csv('USData_ClassProject1.csv')

In [2]:
import scipy.stats as stats
left_handed = city_data.MedianIncomeFemale
right_handed = city_data.MedianIncomeMale
t,p = stats.ttest_ind(left_handed, right_handed, equal_var=False)

In [3]:
print "Median Income Female:"
print np.mean(city_data.MedianIncomeFemale)

print "\nMedian Income Male:"
print np.mean(city_data.MedianIncomeMale)

print "\nP-value:"
print p


Median Income Female:
36703.7523585

Median Income Male:
48212.9225629

P-value:
2.51047916022e-179

Male vs Female income

We have confirmed than Mans get more $ than Womans. The median income for a woman is about 37k and the median income for a man is about 48k. The p-value is