I have a txt file which looks like this:
0.41,"[1.0, 0.0, 1.0]","[16.4, 0.0, 0.0]"
0.23,"[0.0, 2.0, 2.0]","[32.8, 0.0, 0.0]"
0.19,"[0.0, 0.0, 3.0]","[92.8, 0.0, 0.0]"
and I hope to read it and convert the strings to lists:
a=[0.41, 0.23, 0.19, 0.03, 0.02, 0.02]
b=[[1.0, 0.0, 1.0],[0.0, 2.0, 2.0],[0.0, 0.0, 3.0]]
c=[[16.4, 0.0, 0.0],[32.8, 0.0, 0.0],[92.8, 0.0, 0.0]]
How can I do this in python?
Thanks in advance,
Fei
a=[0.41, 0.23, 0.19, 0.03, 0.02, 0.02]with your sample input. It doesn't make sense. You can only have 3 values for each list or I'm lost in the logic.