statistics in python

T-test uses a statistical examination of two population means.
To perform t-test in python, scipy package is good tool to do that.
For example
I have data, that collected two times.
1st time [54.3, 55.2, 55.0, 56.4, 53.1, 53.1]
2nd time [56.5, 54.8, 58.2, 57.8, 59.0, 60.7]
Is there the difference in means of two data ?
in python…

import scipy.stats as stats
a = [54.3, 55.2, 55.0, 56.4, 53.1, 53.1]
b = [56.5, 54.8, 58.2, 57.8, 59.0, 60.7]
res = stats.ttest_rel(a,b)

res has two data, 1. t-value, 2. provability. Like this.

In [10]: stats.ttest_rel(a,b)
Out[10]: (array(-2.7458856580188598), 0.040507701177115191)

Easy to do it. ;-)

Advertisement

Published by iwatobipen

I'm medicinal chemist in mid size of pharmaceutical company. I love chemoinfo, cording, organic synthesis, my family.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: