我有一個龐大的資料檔案,以任何方式都無法處理。該檔案的結構如下。為了能夠處理資料,我想裁剪資料步驟,所以我在檔案中只有每 50 個步驟。然后它將以來自 Direct configuration= 1、Direct configuration= 50 等的資料結束。有誰知道從哪里開始實作這一目標?
Generic Input
1
9.911879 -0.001977 0.001562
-0.002156 10.766003 0.001154
0.002104 0.001503 12.939863
Si Ge Li N O
8 24 32 32 32
Direct configuration= 1
0.24672335 0.21343837 0.06644162
0.25680732 0.21274439 0.56108128
0.75202052 0.21114493 0.06961516
.
.
.
Direct configuration= 2
0.24650415 0.21279551 0.06873548
0.25388539 0.21261272 0.55851287
0.74968128 0.20877708 0.06763310
.
.
.
等等
uj5u.com熱心網友回復:
當您閱讀檔案時,如果行的 mod 為 0,您可以進行不同的陳述句并更改目標。例如:
count = 0
with open(file,''r) as file:
for row in file:
count =1
if count % 50 = 0
--change destination--
轉載請註明出處,本文鏈接:https://www.uj5u.com/qiye/486480.html
