I have something like:
'[356, 1079, 1220, 1060, 3039, 1197, 4085, 4002, 2395]'
but I want:
[356, 1079, 1220, 1060, 3039, 1197, 4085, 4002, 2395]
how can I do this in python?
I have something like:
'[356, 1079, 1220, 1060, 3039, 1197, 4085, 4002, 2395]'
but I want:
[356, 1079, 1220, 1060, 3039, 1197, 4085, 4002, 2395]
how can I do this in python?
a = ['[356, 1079, 1220, 1060, 3039, 1197, 4085, 4002, 2395]']
a_real_list = json.loads(a[0])
or
a_real_list = ast.literal_eval(a[0])
or
a_real_list_of_str = a[0][1:-1].split(", ")