shaifali Gupta shaifali Gupta - 4 months ago 12
Python Question

Python convert string to list

How can we convert


['[0.0034596999 0.0034775001 0.0010091923]']


to


[[0.0034596999 0.0034775001 0.0010091923]]


without quotes. I tried using eval, list, tuple, replace and s.strip() but nothing seems to work. Can anyone help on this

Answer
lst = ['[0.0034596999 0.0034775001 0.0010091923]']
item = ''.join(lst)
final_str = "[" + item + "]"
print (final_str)