3

I have two numpy arrays with different sizes that I would like to run a t-test on directly in python to see the p-value.

Stack_Protégé
  • 302
  • 1
  • 15

1 Answers1

6

You can use Scipy Library, you can install it using 'pip install scipy'

from scipy import stats
print(stats.ttest_ind(arr1, arr2))

It returns tuple of calculated t-statistic and two-tailed p-value

Reference Documentation

Cute Panda
  • 1,468
  • 1
  • 6
  • 11