我有這個巨大的文本文件,我想在分鐘的頂部獲取具有關(guān)聯(lián)數(shù)據(jù)的行。這是來自該文本文件的幾行。這是超過 36 小時的數(shù)據(jù)片段。我所說的關(guān)聯(lián)是指時間戳后面的 8 個數(shù)據(jù)點(diǎn)。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 查看時間戳的秒部分,然后創(chuàng)建一個僅包含與“:00”秒相關(guān)聯(lián)的數(shù)據(jù)的新列表。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 循環(huán)的正確區(qū)域嗎?
- 0 回答
- 0 關(guān)注
- 140 瀏覽
添加回答
舉報(bào)
0/150
提交
取消
