I would like to change my dataframe with values into binary,
given df:
| summary | word1 | word2 |
|---|---|---|
| xyz | 0 | 56 |
| abc | 32 | 0 |
| .. | .. | .. |
I would like to convert ONLY NUMERIC values to binary, meaning - if the value in word1/2 etc is grater than 0 -> 1 and when it's 0 = stays 0.
| category | summary | word1 | word2 |
|---|---|---|---|
| category1 | xyz | 0 | 1 |
| category2 | abc | 1 | 0 |
| .. | .. | .. |
df.dtypes)