How to sum numbers which are strings in a column in a pandas dataframe?

Solution 1:

Change:

TotalRaw['lr_y'] = [sum(int(x) for x in string.split()) for string in TotalRaw['lr_y']]

To:

TotalRaw['lr_y'] = [sum(float(x) for x in string.split()) for string in TotalRaw['lr_y']]