I have a string type column which contains a list of elements which are nested dictionary objects. E.g
str = '[{"method":
{"super":0.03,"normal":0.8,"par":0.15,"goal":0.01,"fact":0.04},
"city":["nyc","atlanta"],
"description":"some description",
"content_type":"media"},
{"method":
{"super":0.03,"normal":0.8,"par":0.15,"goal":0.01,"fact":0.04},
"city":["chicago","dallas"],
"description":"some description2",
"content_type":"web"},
{"method":
{"super":0.03,"normal":0.8,"par":0.15,"goal":0.01,"fact":0.04},
"city":["las vegas","buffalo"],
"description":"some description3",
"content_type":"media"}]'
This is actually a column in a spark dataframe which is of a string type. So I want to know how to convert the contents of a string into a list such that I can convert each element in the list using json.loads.
Any idea?