我有这个巨大的文本文件,我想在分钟的顶部获取具有关联数据的行。这是来自该文本文件的几行。这是超过 36 小时的数据片段。我所说的关联是指时间戳后面的 8 个数据点。2020-08-03 22:17:12,0,0,4803,4800,91,28.05,24.05,58.89172020-08-03 22:17:13,0,0,4802,4800,91,28.05,24.05,58.89252020-08-03 22:17:14,0,0,4805,4800,91,28.05,24.05,58.93412020-08-03 22:17:15,0,0,4802,4800,91,28.05,24.05,58.96832020-08-03 22:17:18,0,0,4802,4800,91,28.05,23.05,58.978...我找不到一种方法让 python 查看时间戳的秒部分,然后创建一个仅包含与“:00”秒相关联的数据的新列表。for line in fh: line = line.rstrip("\n") line = line.split(",") masterlist.extend(line) #this is putting the information into one list altmasterlist.append(line) #this is putting the lines of information into a listfor line in altmasterlist: if ":00" in line: finalmasterlist.extend(line) #Nothing is entering this if statementprint(finalmasterlist)我什至在这两个 for 循环的正确区域吗?
目前暂无任何回答
- 0 回答
- 0 关注
- 96 浏览
添加回答
举报
0/150
提交
取消