Here is a sample of my dataframe:
| personUID | lr | diagnosis |
|---|---|---|
1234 |
65.1 63.38957151969269 90.221 |
ICD10_R99 |
When running the following command to sum the values in lr:
TotalRaw['lr_y'] = [
sum(int(x) for x in string.split()) for string in TotalRaw['lr_y']
]
I receive the following error:
ValueError: invalid literal for int() with base 10: '63.38957151969269'
The values in lr are strings as I had to convert them from float to strings in order to use group_by. Now I can't convert them back to strings nor can I use string.split(), any tips on how to resolve these errors?