write data loader
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,3 +1,4 @@
|
||||
*.swp
|
||||
*.json
|
||||
*.bak
|
||||
*.dat
|
@@ -1,5 +1,19 @@
|
||||
import json
|
||||
with open("A1_res.json", "r") as file:
|
||||
content=json.load(file)
|
||||
for lst in content:
|
||||
print(lst[0])
|
||||
fout1=open("tmp1.dat","w")
|
||||
for node_point in range(225):
|
||||
for time_point in range(301):
|
||||
v=content[time_point][node_point]["v"]
|
||||
print(v,'\t',file=fout1,sep="",end="")
|
||||
print('\n',file=fout1,end="",sep="")
|
||||
fout2=open("tmp2.dat","w")
|
||||
for node_point in range(225):
|
||||
for time_point in range(301):
|
||||
x=content[time_point][node_point]["node"][0]
|
||||
print(x,'\t',file=fout2,sep="",end="")
|
||||
print('\n',file=fout2,end="",sep="")
|
||||
for time_point in range(301):
|
||||
y=content[time_point][node_point]["node"][1]
|
||||
print(y,'\t',file=fout2,sep="",end="")
|
||||
print('\n',file=fout2,end="",sep="")
|
Reference in New Issue
Block a user