I have a dataframe with 5 columns. I need to create a 6th column which should be the result of an if-else operation performed on 3 columns from the dataset.
index | prediction | response | lwr | upr |
---|---|---|---|---|
23 | 22.707441 | 25.0 | 21.762679 | 23.65220 |
86 | 13.568034 | 13.0 | 12.789159 | 14.34691 |
96 | 9.138957 | 12.0 | 7.628405 | 10.64951 |
111 | 26.375961 | 22.0 | 25.559815 | 27.19211 |
121 | 21.656960 | 19.0 | 20.738612 | 22.57531 |
140 | 10.715798 | 14.0 | 9.561180 | 11.87042 |
153 | 20.579496 | 19.0 | 19.985751 | 21.17324 |
I have to create a new column called 'result' to which should be equal to "yes" if the value in 'response' column is higher than the value in 'lwr' column and lesser than the value in 'upr' column for each row.
Else the value should be "no".