当前位置:网站首页>IndexError: only integers, slices (`:`), ellipsis (`...`), numpy.newaxis (`None`) and integer or boo
IndexError: only integers, slices (`:`), ellipsis (`...`), numpy.newaxis (`None`) and integer or boo
2022-08-02 03:21:00 【woshicaiji12138】
max0=max(val[i][0],val[i][1])
min0=min(val[i][0],val[i][1])
high[min0]=h+x
high[max0]=h+x
今天刷题时上述代码出现如下错误:
IndexError: only integers, slices (:), ellipsis (...), numpy.newaxis (None) and integer or boolean arrays are valid indices
原因是索引Index不能用浮点数,应该改为整型:
max0=int(max(val[i][0],val[i][1]))
min0=int(min(val[i][0],val[i][1]))
high[min0]=h+x
high[max0]=h+x
边栏推荐
猜你喜欢

活体检测 Adaptive Normalized Representation Learning for GeneralizableFace Anti-Spoofing 阅读笔记

【遥控器开发基础教程3】疯壳·开源编队无人机-ADC(摇杆控制)

5.合宙Air32F103_LCD_key

Daily practice------There are n integers, so that the previous numbers are moved back m positions in order, and the last m numbers become the first m numbers

磷脂-聚乙二醇-醛基 DSPE-PEG-Aldehyde DSPE-PEG-CHO MW:5000

bgp机房的动态路由和静态路由的区别

MySql创建数据表

OD-Model【4】:SSD

@DateTimeFormat注解

DSPE-PEG-DBCO 磷脂-聚乙二醇-二苯并环辛炔 一种线性杂双官能聚乙二醇化试剂
随机推荐
线性代数学习笔记2-1:向量和向量组、线性相关性(张成空间的概念)
mysql中exists的用法详解
5.合宙Air32F103_LCD_key
day11--shell脚本
弹性盒子flex属性
DSPE-PEG-DBCO 磷脂-聚乙二醇-二苯并环辛炔 一种线性杂双官能聚乙二醇化试剂
腾讯50题
支付通道对接常见的问题有哪些?
rem adaptation
【程序人生】做了多年的运维,靠什么转行拿下12K+年终奖的薪资?
SSM整合
rem适配
一种基于行为空间的回声状态网络参数优化方法
基于libmodbus库实现modbus TCP/RTU通信
化学试剂磷脂-聚乙二醇-羟基,DSPE-PEG-OH,DSPE-PEG-Hydroxyl,MW:5000
(forwarded) HashCode summary (2)
HCIP第十一天_MPLS实验
STL entry basics map and set containers
手把手带你 Unity 入门之从零创建一个时钟(GameObjects 与 Scripts)
@Autowired注解的使用