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 ...
随机推荐
- Mybatis运用到的3种设计模式
Mybatis运用到的3种设计模式 1.构造者模式2.工厂模式3.代理模式1.构造者模式 使用SqlSessionFactoryBuilder,根据核心配置文件,构造一个SqlSessionFacto ...
- C++构造函数实例
#include<iostream> #include <string> using namespace std; class Person { public: //无参(默认 ...
- Acwing-97-约数之和(整数分解, 递推分治)
链接: https://www.acwing.com/problem/content/99/ 题意: 假设现在有两个自然数A和B,S是AB的所有约数之和. 请你求出S mod 9901的值是多少. 思 ...
- 2017noip总结
day0 酒店位置很好,旁边就是玉树公园,3公里处还有万达广场: 晚上去万达吃喝玩乐, 不过,打车等了好久,手机还没电了. 同时水杯还在广州扎根了...(暗示后文悲惨结局) day1 8:30 监考老 ...
- 通过喝水清晰简单了解I/O五大模型
一般单次I/O请求会分为两个阶段,每个阶段对于I/O的处理方式是不同的 I/O会经历一个等待资源的阶段 阻塞,指的是在数据不可用时,I/O请求会一直阻塞,直到数据返回 数据不可用时,立即返回,直到被通 ...
- POJ 3692 幼儿园做游戏 最大团 模板题
Kindergarten Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 6191 Accepted: 3052 Desc ...
- scrapy项目5:爬取ajax形式加载的数据,并用ImagePipeline保存图片
1.目标分析: 我们想要获取的数据为如下图: 1).每本书的名称 2).每本书的价格 3).每本书的简介 2.网页分析: 网站url:http://e.dangdang.com/list-WY1-dd ...
- 【Share Code | Javascript & HTML & CSS】链接悬停显示图像效果
demo & 代码 链接悬停效果,显示缩略图. 今天给大家分享一组链接悬停效果.悬停链接时显示具有特定效果的缩略图. 这是一些效果: 参考 Image Reveal Hover Effects
- 20175215 2018-2019-2 第八周java课程学习总结
第十五章 泛型与几何框架 15.1 泛型 泛型(Generics)是在JDK1.5中推出的,其主要目的是可以建立具有类型安全的集合框架,如链表.散列映射等数据结构. 15.1.1 泛型类声明 可以使用 ...
- weblogic报:java.lang.LinkageError: loader constraint violation in interface itable initialization
原因分析: gdaml服务中依赖org.apache.xerces_2.9.0.v201101211617.jar会产生jar包冲突 解决方法: 项目中的这个jar包删除,并将这个jar包放在服务器中 ...