Entering edit mode
6.2 years ago
kamyasingh90
▴
10
Hi
I am trying to perform t test and ranksum test on my data. My input csv file looks like :
SRA ID ERR169499 ERR169498 ERR169497
Label 1 0 1
TaxID PRJEB3251_ERR169499 PRJEB3251_ERR169499 PRJEB3251_ERR169499
333046 0.05 0.99 99.61
1049 0.03 2.34 34.33
337090 0.01 9.78 23.22
99007 22.33 2.90 0.00
I want to calculate the T- Test and rank sum test for every TaxID as in for every row. The code I have so far is :
df = pd.read_csv('final_out_transposed.csv')
for row in df.iterrows():
tt_val, p_ttest = ttest_ind(df.sum_case, df.sum_ctrl)
tr_val, p_ranksum = ranksums(df.sum_case, df.sum_ctrl)
print(tt_val)
print(p_ttest)
print(tr_val)
print(p_ranksum)
It is not helping me. I am guessing i have to use groupby. Any help will be highly appreciated.
What's the error message? Also, isn't that going to attempt to perform the test on the first 3 header columns?
Check that there are no NAs (manage these with
nan_policy
), and also check your indices insum_case
andsum_ctrl