scipy documentation describes a module [scipy.stats.permutation_test].1
when I try using this module in Jupyter Notebook, as shown below, I get:
"AttributeError: module 'scipy.stats' has no attribute 'permutation_test'".
Looking at all the attributes for scipy.stats in the Notebook, permutation_test is not listed. Does the permutation_test module really exist in scipy, or is this an Anaconda distribution issue?
import numpy as np
import scipy.stats as sps
def stat_q25(x, y):
return np.quantile(x, 0.25) - np.quantile(y, 0.25)
test_q25 = sps.permutation_test(data = (x, y), statistic = stat_q25, alternative = 'greater')
Probably your python version is too low. If you update it to higher version, for example 3.8, you can install a higher version of scipy, permutation_test will be included.
I had the same issue and solved it recently.
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