I have two columns, weight
and area
. I want to create two columns as follows:
- out1: If
weight
> 12, top, else down. - out2: If
area
> -0.5, insert a value of 0. Otherwise round the absolute value ofarea
with 0.5 mapping to 1.
Desired output:
weight area out1 out2
12 3 down 0
13 -0.4 top 0
11 2.5 down 0
17 -0.5 top 1
16 -3.7 top 4
14 -1.2 top 1
11 -4.8 down 5