Hello,

I have a variable that has the numeric values of 0 to 9 within that column.

I would like to convert these numbers so that the value of 0 remains 0 while the values of 1,2,3...9 all become 1.

I want to do this as I am running a logistic regression and I need this variable to become my target so if anyone can help me to convert these values into 1 that would be really amazing. This has frustrated me for the past hour because it seems so simple but I just can't get it. Thanks in advance!

Edit: I have added what I hope for the change to look like visually.

Weeks ------> Weeks

0 ------------------- 0

1 ------------------- 1

5 ------------------- 1

9 -------------------- 1

2 -------------------- 1

7 -------------------- 1

0 -------------------- 0

2 -------------------- 1

0 -------------------- 0