Might sounds like a duplicate question, but it is slightly different than what I have found here. I have the following pandas DF (without the new column), and I want to create the new_column
| chicken | cow | moose | goat | pigeon | new column |
|:--------|:----|:------|:-----|:-------|:---------------------------------|
| 0 | 0 | 0 | 0.2 | 0 | [goat] |
| 0.4 | 0.2 | 0 | 0 | 0 | [chicken, cow] |
| 0.2 | 0 | -0.2 | 0.1 | 0.3 | [chicken, moose, goat, pigeon] |
| 0 | 0 | 0 | 0 | 0 | [ ] |
I was thinking to make an empty column first, and then append the column value in the new cell when != 0. However, haven't been able to find the solution though. I feel it shouldn't be that hard.. any help from the community?
