I have a unique situation. I get a data from the field in row format. Each row contains a timestamp, a list of values. It is in string format. I am trying to convert it to a normal list.
My code:
df=
A
0 '1.2,1.3'
1 '2.2,2.3'
2 '3.2,3.3,'
3 '4.2,4.3'
import ast
df['A'] = df['A'].applymap(ast.literal_eval).applymap(list)
Present output:
ValueError: malformed node or string:
[3.2,3.3]
Expected output:
df=
A
0 [1.2,1.3]
1 [2.2,2.3]
2 [3.2,3.3]
3 [4.2,4.3]