I have a list like this:
| slope | lower_limit | upper_limit | limit |
|-------|-------------|-------------|-------|
| -0.5 | 23 | 25 | 0 |
| 0.6 | 23 | 25 | 0 |
| 0.7 | 23 | 25 | 0 |
I want to update values of the limit column from the lower limit and upper limit columns, depending of the sign of the slope column. I would like the resulting table to look like this:
| slope | lower_limit | upper_limit | limit |
|-------|-------------|-------------|-------|
| -0.5 | 23 | 25 | 23 |
| 0.6 | 23 | 25 | 25 |
| 0.7 | 23 | 25 | 25 |
I am currently using an if, but it changes the value of the whole column, resulting in all values in the limit column being 25
depending of the sign of the slope? depending on what logic?