当前位置:网站首页>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
边栏推荐
猜你喜欢
随机推荐
第十一天&shell脚本
分布式领域最重要的一篇论文,到底讲了什么?
(Repost) HashCode Summary (1)
MySQL中字符串比较大小(日期字符串比较问题)
Day34 LeetCode
UserWarning: torch.meshgrid: in an upcoming release, it will be required to pass the index ing argu
MySQL删除表数据 MySQL清空表命令 3种方法
DAY-1 | 求两个正整数的最大公约数与最小公倍数之和——辗转相除法
MySQL分区表详解
JVM学习----垃圾回收--G1
多个el-select下拉框无法选中相同内容
Mysql8创建用户以及赋权操作
day11--shell脚本
@ApiModel 和 @ApiModelProperty
np.unique()函数
Double Strings (别总忘记substr)
[Remote Control Development Basic Tutorial 3] Crazy Shell Open Source Formation UAV-ADC (Joystick Control)
小程序(开发必备常识)1
线性代数学习笔记3-3:逆矩阵的理解
删库后!除了跑路还能干什么?