-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.py
More file actions
32 lines (29 loc) · 842 Bytes
/
test.py
File metadata and controls
32 lines (29 loc) · 842 Bytes
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
import json
import networkx as nx
from networkx import *
import pandas as pd
import csv
kspace = read_yaml('kspace.yaml')
json_data = open('output.json').read()
data = json.loads(json_data)
def writer(target,tbw):
with open(target,'w') as outfile:
json.dump(tbw,outfile)
row0 = []
row1 = []
row2 = []
row3 = []
row4 = []
for each in data:
row0.append(each[0])
row1.append(each[1])
row2.append(each[2])
row3.append(each[3])
row4.append(each[4])
with open('output.csv', mode='w+') as employee_file:
employee_writer = csv.writer(employee_file, delimiter=',', quotechar='"', quoting=csv.QUOTE_MINIMAL)
employee_writer.writerow(row0)
employee_writer.writerow(row1)
employee_writer.writerow(row2)
employee_writer.writerow(row3)
employee_writer.writerow(row4)