TypeError: reduction operation 'argmax' not allowed for this dtype
这个错误真的tmd伤脑筋。我用idxmax函数去求series类型的最大值的索引,结果明明是下面这种数据,

无论我如何pint他的shape,type,他怎么看都是一个满足idxmax函数要求的参数类型:标准的Series类型,且每个元素都是浮点数,
但是:

然鹅,当我最后在调试中看到了一个不起眼的地方

这个貌似元素为浮点数的Series变量,啥时候元素类型成了object,我不得而知,也不想知道,我只知道,我需要加上一行美丽的代码
results_table['Mean_recall_score'] = results_table['Mean_recall_score'].astype('float64')
以及以后一定一定要注意DataFram中的元素类型
TypeError: reduction operation 'argmax' not allowed for this dtype的更多相关文章
- TypeError: reduction operation 'argmin' not allowed for this dtype
解决方法:在idxmax()前加.astype(‘float64’) .argmin() .argmax() 计算最大.小值所在位置的索引(针对自动索引的)(适用于Series类型:) .idxmin ...
- 破解LR时,解决loadrunner 破解错误:license security violation.Operation is not allowed
一.由于在压力测试执行中,出现一个-10803的错误 ,为解决这个错误,重新设置的环境变量,在次执行错误,这个问题解决了,但另外一个问题出来了,LR,打开脚本编辑器老提示找不到TEMP目录,当时没有想 ...
- ValueError: output parameter for reduction operation logical_and has too many dimensions ?
https://docs.scipy.org/doc/numpy-dev/reference/generated/numpy.all.html#numpy.all 运行示例,却发生错误 import ...
- loadrunner破解出现“license security violation,Operation is not allowed”的错误提示
1.关闭loadrunner,将破解文件(“lm70.dll”.“mlr5lprg.dll”)放置在LoadRunner\bin下面 2.以管理员身份运行loadrunner,在CONFUGURATI ...
- ValueError: zero-size array to reduction operation maximum which has no identity
数据打印到第530行之后出现以下异常,求解!
- loadrunner11破解失败,已解决“ license security violation.Operation is not allowed ”问题
参考链接https://blog.csdn.net/yongrong/article/details/7891738,亲测可以解决问题 在64位win7系统中安装LR11时,采用普通的方法无法授权.最 ...
- Reduction operations
Reuction operations Reduction operations A reduction operations on a tensor is an operation that red ...
- (转) NAS(神经结构搜索)综述
NAS(神经结构搜索)综述 文章转载自:http://www.tensorinfinity.com/paper_136.html 本文是对神经结构搜索(NAS)的简单综述,在写作的过程中参考了文献[1 ...
- 【Caffe】源码解析----caffe.proto (转载)
分析caffe源码,看首先看caffe.proto,是明智的选择.好吧,我不是创造者,只是搬运工. 原文地址:http://blog.csdn.net/qq_16055159/article/deta ...
随机推荐
- 红帽Linux故障定位技术详解与实例(4)
红帽Linux故障定位技术详解与实例(4) 在线故障定位就是在故障发生时, 故障所处的操作系统环境仍然可以访问,故障处理人员可通过console, ssh等方式登录到操作系统上,在shell上执行 ...
- graphviz 决策树绘图中文乱码解决方法
1.修改graphviz配置文件 <dir>C:\WINDOWS\Fonts</dir> 更改为 <dir>~/.fonts</dir> 2.将决策树d ...
- shell中的控制流结构
shell中的控制流结构 1.if...then..else..fi语句 2.case语句 3.for循环 4.until 语句 5.while循环 6.break控制 7.continue 控制 1 ...
- electron桌面通知,修改默认通知应用名electron.app.Electron为自己应用的名称
在做electron桌面通知时,按照文档实现弹出通知,但是默认的应用名为electron.app.Electron 解决办法 就是在主进程中设置 app.setAppUserModelId('myAp ...
- vue 绑定class、v-bind:style(对象语法、数组语法)
绑定 HTML Class 我们可以传给 v-bind:class 一个对象,以动态地切换 class: 内联样式在模板里 <div id="div1" :class=&qu ...
- [人物存档]【AI少女】【捏脸数据】写实系列
点击下载:AISChaF_20191023202713797.zip 点击下载:AISChaF_20191023202713797.zip
- js 创建节点 以及 节点属性 删除节点
case 'copy': var B1 = document.getElementById("B1"); //获得B1下的html文本 var copy_dom = documen ...
- Java中 DecimalFormat 用法详解
我们经常要将数字进行格式化,比如取2位小数,这是最常见的.Java 提供DecimalFormat类,帮你用最快的速度将数字格式化为你需要的样子.下面是一个例子: import java.text.D ...
- ORACLE/SQL用函数进行每年,每月,每周,每日的数据汇总
15/03/21 用函数进行每年,每月,每周,每日的数据汇总 假设一个销售明细表 sale_detail 含有 国家(country),销售时间(sale_time),销售额(sale_money) ...
- [HG]腿部挂件 题解
前言 暴力跑的比正解快. 以下暴力(循环展开+fread读入输出优化) #include<cstdio> #pragma GCC optimize(3, "Ofast" ...