当前位置: 首页 > news >正文

iis一个文件夹配置多个网站如何自己开一个网站

iis一个文件夹配置多个网站,如何自己开一个网站,精品课程网站建设验收单,WordPress 转移数据我想删除90%的转向值等于0的行。这三个图像都有一个对应的图像文件#xff0c;中间#xff0c;左边和右边。我也要删除它们。csv文件如下#xff1a;我编写了以下代码#xff0c;以至少获取转向值为0的文件。我所需要的就是随机获取90%的文件并删除它们的代码。…我想删除90%的转向值等于0的行。这三个图像都有一个对应的图像文件中间左边和右边。我也要删除它们。csv文件如下我编写了以下代码以至少获取转向值为0的文件。我所需要的就是随机获取90%的文件并删除它们的代码。 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18with open(data/driving_log.csv) as csvfile: reader csv.reader(csvfile) for i,line in enumerate(reader): lines.append(line) index.append(i) lines np.delete(lines,(0), axis 0) for i, line in enumerate(lines): #print(type(line[3].astype(np.float))) line_no.append(line[3].astype(np.float32)) #print(line_no[i]) if line_no[i]0.0: # this gets the first column of the row. for j in range(3): source_path line[j] filename source_path.split(/)[-1] print(filename) count 1 您是否搜索过如何在python中生成随机数和删除文件生成随机数。删除文件。 是的我需要随机导入并使用os.remove()删除文件。但是我在两个地方感到困惑从csv文件中删除一行随机删除90%的转向值等于0的文件。 你能把你的csv文件的一部分以文本格式发布吗最好用逗号作为分隔符。 而且您的代码是不完整的。很多未定义的变量。 img/中_2016_12_01_13_30_48_287.jpgimg/左_2016_12_01_13_48_287.jpgimg/右_2016_12_01_13_48_287.jpg00022.14829。 我添加了代码开始工作的部分。在此之前它只是导入包并初始化变量。 我认为这会满足你的需求 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39import csv from random import randint from os import remove # Create a 2D list from which we can work with lines [] with open(data/driving_log.csv, newline) as csvfile: reader csv.reader(csvfile) for line in reader: lines.append(line) # Find 10% of total lines (to keep), not including header row numToKeep round(sum(1 for i in lines if i[3] 0) * 0.1) # Save 10% of lines to a new 2D list toKeep [] for i in range(numToKeep): while True: index randint(1, len(lines)-1) # Make sure we havent already selected the same line if lines[index] not in toKeep and lines[index][3] 0: toKeep.append(lines[index]) break # Deleting all files of the selected 90% of rows for i, line in enumerate(lines): if i 0: # Omit the header row continue if lines[i][3] ! 0: # Keep rows that dont have a steering value of 0 toKeep.append(lines[i]) if line not in toKeep: print(Deleting: {}.format(line)) for i in range(3): remove(line[i]) with open(data/driving_log.csv, w, newline) as csvfile: writer csv.writer(csvfile) writer.writerows([lines[0]]) # Put the header back in writer.writerows(toKeep) 我意识到这不是最优雅的解决方案。我对numpy不熟悉现在也没有时间去学习但这应该管用。 嘿谢谢你。但我看不出转向角需要为0的条件。另外我还想删除相应的文件。就像我想删除img文件夹中的center_2016_12_01_13_30_48_287.jpg。你能帮我做这两件事吗 这行if lines[index] not in toKeep and lines[index][3] 0:指出如果我们还没有将该行添加到要保留的行列表中并且如果转向柱等于0那么…… 这些行for i in range(3):和remove(line[i])将删除该行的3个文件中的每一个。
http://www.zqtcl.cn/news/687410/

相关文章:

  • 购物网站开发文献综述潮汕网站建设
  • 做五金生意什么网站做比较好网站建设市场规模
  • 网站跟app的区别是什么网络搭建结构图
  • 淘宝网站怎么做视频教程山西推广型网站开发
  • 杭州开发网站2018主流网站建设语言
  • 杂志社网站建设方案书响应式网站服务
  • 青岛网站开发建设农村建设有限公司网站
  • 做水晶接单在哪个网站接php做购物网站怎么样
  • 网站内部结构优化网页设计网站搭建
  • 杭州公司建设网站网络营销是一种什么营销
  • 事业单位网站建设费科目定西市小企业网站建设
  • 温州网站推广哪家好网站开发所遵循的
  • 没有网站做APP公司logo设计公司logo设计
  • 网站建设在哪个软件下做中国最大的现货交易平台
  • 西宁做网站公司电话加强局网站建设
  • 佛山做企业网站公司做贸易做个外贸网站有必要吗
  • 南昌制作网站的公司wordpress 分享到插件
  • 大型网站怎样做优化PHP站长工具怎么用
  • 响应式模板网站建设营销型网站建设怎么收费
  • 夺宝网站开发全网seo优化电话
  • 宁夏建设工程招标投标信息管理中心网站广告多的网站
  • c 网站做死循环北京响应式的网站设计
  • 手机门户网站建设莱芜雪野湖国际会议中心酒店
  • 男人女人做那事网站vue加wordpress
  • 古色古香 网站模板西安企业黄页网站
  • 上海企业网站怎么建设交互设计网站有哪些
  • 企业网站设计与制作开发一款游戏app需要多少钱
  • 贵阳网站方舟网络北京手机网站制作
  • 烟台小学网站建设做盗版电影网站问题
  • 做网站语言知乎长春财经学院学费多少