0

I am trying to test whether two samples have the same distribution by using cramervonmises_2samp, in Juypter notebook, but I got this error "module 'scipy.stats' has no attribute 'cramervonmises_2samp'" when trying the example on page of scipy.stats.cramervonmises_2samp

import numpy as np
from scipy import stats
rng = np.random.default_rng()
x = stats.norm.rvs(size=100, random_state=rng)
y = stats.norm.rvs(size=70, random_state=rng)
res = stats.cramervonmises_2samp(x, y)
res.statistic, res.pvalue

Any suggestions ? Many thanks

I copy and paste the code of example in notebook, but it keeps showing the error.

Dora
  • 1
  • 1

1 Answers1

0

That function was added in scipy version 1.7.0. I suspect you have an older version and need to update to a newer one.

rpatel3001
  • 147
  • 1
  • 11