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