I have following dataframe
| A | B | C | D | E |
|---|---|---|---|---|
| -0.1 | 0 | 0.2 | 0 | 4 |
| 0 | 0 | -1 | -2 | 5 |
I would like an output as following based on A,B belong to category X and C,D,E belong to category Y -
| A | B | C | D | E |
|---|---|---|---|---|
| -cat X | 0 | +cat Y | 0 | +cat Y |
| 0 | 0 | -cat Y | -cat Y | +cat Y |
It basically checks the column name and assigns a category and checks the value to assign a sign. Is there any easy way to do this in Python? I am using COLAB, so probably have latest version.