当前位置:网站首页>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:33:00 【woshicaiji12138】
max0=max(val[i][0],val[i][1])min0=min(val[i][0],val[i][1])high[min0]=h+xhigh[max0]=h+xThe following error occurred in the above code when brushing the question today:
IndexError: only integers, slices (:), ellipsis (...), numpy.newaxis(None) and integer or boolean arrays are valid indices
The reason is that the index Index cannot be a floating point number, it should be changed to an integer type:
max0=int(max(val[i][0],val[i][1]))min0=int(min(val[i][0],val[i][1]))high[min0]=h+xhigh[max0]=h+x边栏推荐
猜你喜欢
随机推荐
我的两周年创作纪念日
(forwarded) HashCode summary (2)
mysql卸载详细教程
@Autowired与@Resource区别
磷脂-聚乙二醇-醛基 DSPE-PEG-Aldehyde DSPE-PEG-CHO MW:5000
RHCSA第三天
JJWT工具类
HCIP-第十一天-MPLS+BGP
浏览器的工作原理(dns域名服务器,tcp握手,ssl/tls安全协议,关键渲染路径,重绘及回流,防抖和节流)
About cross-domain issues
oracle inner join and outer join
RHCSA第二天
Double Strings (don't always forget substr)
数据库操作作业
day11--shell脚本
[详解C语言]一文带你玩转C语言小游戏---扫雷
HCIP第十一天_MPLS实验
3分钟带你了解微信小程序开发
线性代数学习笔记3-2:矩阵乘法的理解
getattr()函数解析









![[详解C语言]一文带你玩转C语言小游戏---扫雷](/img/9f/3979ef063f10bd641111aa4f4d8b4e.png)