Question: i have an issue with my python code that i need to fix as you can see i ' m trying to loop throught a
i have an issue with my python code that i need to fix as you can see im trying to loop throught a data frame and find values but it won't work # Loop through rows and perform statistical tests
for i in rangedflen:
fluvalues nplogdfiloci dfcolumns.isinflusamplenamestolist
rsvvalues nplogdfiloci dfcolumns.isinrsvsamplenamestolist
# Onesample ttest for flu samples
dfati "meanfluratio" npmeanfluvalues
dfatipvalueflu" stats.ttestsampnplogdfiloci dfcolumns.isinflusamplenamestolistpvalue
# Onesample ttest for rsv samples
dfati "meanrsvratio" npmeanrsvvalues
dfatipvaluersv stats.ttestsamprsvvalues, pvalue
# Correct pvalues for multiple testing using Bonferroni correction
dfcorrectedpvaluersv dfpvaluersv dflen
dfcorrectedpvalueflu" dfpvalueflu" dflen
# Mark genes differentially expressed based on conditions
dfSelectedrsvfeature"dfcorrectedpvaluersv & npabsdfmeanrsvratio"
dfSelectedflufeature"dfcorrectedpvalueflu" & npabsdfmeanfluratio"
# If it passes either condition, set Selectedfeature True
dfSelectedfeature" dfSelectedrsvfeature" dfSelectedflufeature"i
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
