简体   繁体   English

TypeError: mannwhitneyu() 得到了一个意外的关键字参数“方法”

[英]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.我正在尝试使用 scipy.stats.mannwhitneyu() 和方法参数“渐近”运行 Mann-Whitney 测试,但出现类型错误。 类型错误

Though in the documentation this argument and key exist.尽管在文档中存在此参数和密钥。 See link: https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.mannwhitneyu.html见链接: 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.对于 scipy.stats wilcoxon package,我得到了相同的答案,尽管文档显示为 state 方法作为有效参数。

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. 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- Python 3.7 或 Python 3.10.4 下的导航器。

So, although to my knowledge I thought I had the most recent version of this package installed, I did not.因此,尽管据我所知,我认为我安装了最新版本的 package,但我没有。 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.当我返回 go 并查看此 package 以前版本的文档时,看起来方法在旧版本的 scipy.stats 中不是适用的参数。 I am currently using 1.7.3 in my environments, (the most recent version that Anaconda-Navigator will let me install).我目前在我的环境中使用 1.7.3(Anaconda-Navigator 将让我安装的最新版本)。

So, the limitations of Anaconda Navigator are preventing me from installing the version I actually need for this parameter (1.9.0).因此,Anaconda Navigator 的限制使我无法安装此参数实际需要的版本 (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.简而言之:检查您的 GUI 限制和您的 mannwhitneyu package 版本,并查看方法是否是您安装的特定版本的有效参数。 I'll check back if I find another answer.如果我找到另一个答案,我会回来查看。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 TypeError:得到一个意外的关键字参数 - TypeError: got an unexpected keyword argument TypeError: __init__() 得到了一个意外的关键字参数 'method' - TypeError: __init__() got an unexpected keyword argument 'method' TypeError:得到了意外的关键字参数“ name” - TypeError: got an unexpected keyword argument “name” 类型错误:binarySearch() 得到了一个意外的关键字参数“key” - TypeError: binarySearch() got an unexpected keyword argument 'key' TypeError:histogram()得到了意外的关键字参数“ new” - TypeError: histogram() got an unexpected keyword argument 'new' TypeError:urlopen()获得了意外的关键字参数'headers' - TypeError: urlopen() got an unexpected keyword argument 'headers' TypeError:得到了一个意外的关键字参数“图像” - TypeError: got an unexpected keyword argument 'image' TypeError: concatenate() 得到了一个意外的关键字参数“dtype” - TypeError: concatenate() got an unexpected keyword argument 'dtype' TypeError: UserCreateForm() 得到了一个意外的关键字参数“初始” - TypeError: UserCreateForm() got an unexpected keyword argument 'initial' TypeError: clean() 得到了一个意外的关键字参数 - TypeError: clean() got an unexpected keyword argument
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM