I've a dataframe as below:
Region Votes
A 23
B 26
A 32
B 46
A 32
B 24
I calculated mean of votes for region A and B by following code data.groupby('Region')['Votes'].mean()
.Now I've to do ptest to determine whether this difference is statistically significant.I tried this code
one = data[data['Region']=='one']
two = data[data['Region']=='two']
print(st.ttest_ind(one['Votes'], two['Votes'])).
I'm getting nan in output instead of values i.e
Ttest_indResult(statistic=nan, pvalue=nan)
Can somebody tell me what I'm doing wrong?