I have a data-frame as below named as data. | CHS | POF | COF |REF_COF| per_COF | | :------: |:--------: |:----:|:-----:|:-------:| | 4.72 | 0.00134 |116114|74352 |160 | | 4.34 | 0.00134 |74352 |847100 |100 | | 7.20 | 0.02 |678904|45670 |70 | | 10 | 0.2 |23456 |38089 |88 | | 5.84 | 0.04019 |125678|54351 |200 | | 8.94 | 0.90101 |908522|967387 |38 |
I want to add another column named 'CI' in this existing data-frame, by taking the help of a column named 'per_COF'. When I do this I get desired results,
for key, value in enumerate(data['per_CoF']):
data.loc[key, 'CI'] = find_CI(value)
However, to avoid loops in my program when I do this I'm getting a value error. find_CI() is a function that takes one input and gives the respective CI value.
data['CI'] = find_CI(data['per_CoF'])
Error Description: ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().
This seems silly mistake but I'm not able to figure it out kindly help.