I am trying to perform a t-test with the following. It worked initially. But, now, it is showing the following error,
'numpy.float64' object has no attribute 'ttest_ind'
col=list(somecolumns)
for i in col:
x = np.array(data1[data1.LoanOnCard == 0][i])
y = np.array(data1[data1.LoanOnCard == 1][i])
t, p_value = stats.ttest_ind(x,y, axis = 0,equal_var=False)
if p_value < 0.05: # Setting our significance level at 5%
print('Rejecting Null Hypothesis. Loan holders and non-Loan holders are not same for',i,'P value is %.2f' %p_value)
else:
print('Fail to Reject Null Hypothesis. Loan holders and non-Loan holders are same for',i,'P value is %.2f' %p_value)
I am struggling to find an answer to this. Cant able to resolve.