当前位置:网站首页>enumrate的start属性的坑
enumrate的start属性的坑
2022-07-02 07:44:00 【lanmy_dl】
enumrate的start属性
是这样的,要两个for循环遍历,取出数据,并且第二个for循环可以在第一个之后取节省处理了的时间,我用了enumerate,结果以为start属性和我想的不一样start属性说明
for index1,((xx1, yy1), rr1, grbb1) in enumerate(center): # 从第一个点开始
for index2,((xx2, yy2), rr2, grbb2) in enumerate(center,start=index1+1):
###code
即使下标变成1,还是和第0个相同
原来只是改变开始值的下标,还是从头给你遍历,这样下标虽然记录的变了,但是数据还是从头取。。。
还是老实用for循环把,突然懂了一般训练代码里面有时候用两个for循环
for index1 in range(len(center)):
(xx1, yy1), rr1, grbb1 = center[index1]
for index2 in range(index+1,len(center)):
(xx2, yy2), rr2, grbb2) = center[index2]
###code
边栏推荐
- TIPC messaging3
- [play with FPGA learning 4 in simple terms ----- talk about state machine design]
- [AI application] Hikvision ivms-4200 software installation
- 2022 love analysis · panoramic report of digital manufacturers of state-owned enterprises
- [play with FPGA learning 5 in simple terms ----- reset design]
- Resources读取2d纹理 转换为png格式
- Overview of integrated learning
- 正则及常用公式
- Hdu1228 a + B (map mapping)
- Special topic of binary tree -- acwing 1497 Traversal of the tree (use post and mid order traversal to build a binary tree)
猜你喜欢
TIPC Service and Topology Tracking4
Special topic of binary tree -- acwing 18 Rebuild the binary tree (construct the binary tree by traversing the front and middle order)
[AI application] Hikvision ivms-4200 software installation
二叉树专题--AcWing 47. 二叉树中和为某一值的路径(前序遍历)
Why does LabVIEW lose precision in floating point numbers
TIPC Service and Topology Tracking4
三.芯片啟動和時鐘系統
MongoDB 学习整理(条件操作符,$type 操作符,limit()方法,skip() 方法 和 sort() 方法)
QT学习日记7——QMainWindow
Creation and use of unified links in Huawei applinking
随机推荐
Special topic of binary tree -- acwing 47 Path with a certain value in binary tree (preorder traversal)
二叉树专题--AcWing 1589. 构建二叉搜索树
高德根据轨迹画线
TIPC messaging3
TIPC介绍1
Openmldb meetup No.4 meeting minutes
华为AppLinking中统一链接的创建和使用
洛谷 P4281 [AHOI2008]紧急集合 / 聚会(树上倍增 LCA)
OpenMLDB Meetup No.4 会议纪要
php中self和static在方法中的区别
[in simple terms, play with FPGA learning 3 ----- basic grammar]
Resources读取2d纹理 转换为png格式
TIPC addressing 2
I STM32 development environment, keil5/mdk5.14 installation tutorial (with download link)
QT learning diary 7 - qmainwindow
TIPC Getting Started6
V2X-Sim数据集(上海交大&纽约大学)
QT学习日记8——资源文件添加
洛谷 P3398 仓鼠找 sugar(树上倍增 lca 判断树中两条路径是否相交 结论)
【AI应用】海康威视iVMS-4200软件安装