I have the following code to run Wilcoxon rank-sum test
print stats.ranksums(pre_course_scores, during_course_scores)
RanksumsResult(statistic=8.1341352369246582, pvalue=4.1488919597127145e-16)
However, I am interested in extracting the pvalue from the result. I could not find a tutorial about this. Can someone help?
Use the pvalue
attribute of the returning object:
import scipy.stats as ss
result = ss.ranksums(np.random.randn(10), np.random.randn(10))
result.pvalue
Out: 0.44969179796889092
I assigned it to a variable but you can directly use stats.ranksums(pre_course_scores, during_course_scores).pvalue
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With