sql - Convert string of list to python list -
this question has answer here:
- converting string tuple in python 3 answers
i downloaded csv table database using sql. 1 of fields has values so:
'[0.1234,0.0,0.0]'
i want convert string python list first value. know how convert strings ints , floats... there way de-string object? table got sql web-based viewer, i'm not getting command line.
you take substring index 1
index -1
, split using comma delimiter. in python
array = variable[1:-1].split(',')
should work.
Comments
Post a Comment