To understand the different python data structures and their conversion, I came across a data frame which is displayed below:
The columns refer to ratings of the top 5 from each category i.e. Attraction , Hotel etc.
Here when I access the Attraction_Rating value for the first row in the dataframe, I get a string '[4.5, 4.5,4.5,4.5,5.0]'.
I wanted to understand how can we convert this string back to a list which contains these floats values without using regex. float(s) where s is a string, is clearly not applicable here and I couldn't think of any other simpler solution.
Can anyone please tell me how to do that or point me in the right direction here.
My output should be [4.5, 4.5,4.5,4.5,5.0] i.e. list of floats.
I'll really appreciate any help on this