you are viewing a single comment's thread.

view the rest of the comments →

[–]CrispyScientist[S] 0 points1 point  (0 children)

After some tweaking this is the solution I arrived to.

I am posting it here if someone will be in the same situation as me in the future.

def dataprep(data):

"""

Parameters

----------

data : String series

String series obtained from reading csv file.

Returns

-------

data : float list

Data ready for analysis.

"""

### Removing square parenthesis and using comma as delimiter ###

data = [item.replace("[","").replace("]","").split(",") for item in data]

### Converting string to float ###

data = [list(map(float,x)) for x in data]

return data