df:
gender order
F 1
F 1
M 1
F 1
M 1
F 1
Aim: To check if the mean of F and M are significantly different. I want to check if there is a significant difference between females and males for order 1. (I feel there is something wrong but I cannot figure it out at this stage). My code gives Ttest_indResult(statistic=nan, pvalue=nan)
as a result; I used this ref to the below code:
from scipy.stats import ttest_ind
cat1 = df[df['gender']=='F']
cat2 = df[df['gender']=='M']
t_tst_rsult = ttest_ind(cat1['order'], cat2['order'])
print(t_tst_rsult)