I have a list with this format:
lista_d = [
('1', '2', 1.393063105981541),
('1', '6', 1.450829019495749),
('1', '16', 1.4508291645112752),
('2', '1', 1.393063105981541),
('2', '3', 1.4508290090832596),
('2', '15', 1.4508291577448584),
('3', '2', 1.4508290090832596),
('3', '4', 1.3930630800761916)
]
I need to convert this list to csv with tree columns for example
1 2 1.393063105981541
With all items in list.
I tried with this but but everything is in the first column
with open('dist.csv','w') as f:
write = csv.writer(f)
for i in lista_d:
write.writerow(i)
Can anyone help with this?