简体   繁体   中英

TypeError: mannwhitneyu() got an unexpected keyword argument 'method'

I am trying to run a Mann-Whitney test using scipy.stats.mannwhitneyu() with the method argument 'asymptotic' but I am getting a type error. 类型错误

Though in the documentation this argument and key exist. See link: https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.mannwhitneyu.html

I upgraded to the latest version but it didn't solve it. Any idea why is this happening and how can I fix it?

I am getting the same answer for scipy.stats wilcoxon package, although the documentation appeared to state method as a valid parameter.

But, I noticed that the documentation I was using referenced scipy 1.9.0 ( https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.wilcoxon.html ), which is not available on Anaconda-Navigator under Python 3.7 or Python 3.10.4.

So, although to my knowledge I thought I had the most recent version of this package installed, I did not. When I go back and look at the documentation for previous versions of this package, it looks like method was not an applicable parameter in older versions of scipy.stats. I am currently using 1.7.3 in my environments, (the most recent version that Anaconda-Navigator will let me install).

So, the limitations of Anaconda Navigator are preventing me from installing the version I actually need for this parameter (1.9.0).

In short: check your GUI limitations and your version of the mannwhitneyu package and see if method is a valid parameter for the specific version you have installed. I'll check back if I find another answer.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM