当前位置:网站首页>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+x
The 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
边栏推荐
猜你喜欢
随机推荐
小程序(开发必备常识)1
About cross-domain issues
[Basic Tutorial of Remote Control Development 1] Crazy Shell Open Source Formation Drone-GPIO (Remote Control Indicator Light Control)
TRICK second bullet
(Repost) HashCode Summary (1)
JVM学习----垃圾回收--G1
DOM destruction and reproduction experiment
HCIP第十一天_MPLS实验
Keil development environment installation tutorial
STL入门基础 map和set容器
MySQL分组后取最大一条数据【最优解】
Redis安装,基本命令,持久化方式,集群
Keil开发环境安装教程
动态代理工具类
MySQL分页查询的5种方法
ModuleNotFoundError No module named ‘xxx‘可能的解决方案大全
腾讯50题
HCIP-第十天-BGP综合实验
MySQL中字符串比较大小(日期字符串比较问题)
@ApiModel 和 @ApiModelProperty