Given df
col1
0 -12
1 -64
2 24
3 2
4 6
5 75
6 3
7 10
8 42
9 15
10 14
I'm trying to make something like:
df_new
col1
0 0
1 0
2 1
3 0
4 0
5 1
6 0
7 0
8 1
9 0
10 0
Where, if the number is greater than 15, then it is 1 and 0 otherwise. I tried to do it this way:
df_new = [1 for x in df if (x<15) else 0]
But it gives a syntax error.