I have a DataFrame that is defined by:

```
import pandas as pd

df = pd.DataFrame({'product': ['A', 'B', 'C'], 'feature_1': [1,0,0], 'feature_2': [1,1,1], 'feature_3': [0,0,1] })

```

[![output of <code>display(df)</code>](https://i.stack.imgur.com/P6XG2.png)](https://i.stack.imgur.com/P6XG2.png)

my aim is to:

* add a column called `features`
* fill in this column with the name of all the columns where the value of the *cell* is equal to one

Typically, the end result would be a DataFrame like:

```
df_result = pd.DataFrame({'product': ['A', 'B', 'C'], 'feature_1': [1,0,0], 'feature_2': [1,1,1], 'feature_3': [0,0,1], 'features': ['feature_1, feature_2', 'feature_2', 'feature_2, feature_3'] })

```

[![output of <code>display(df_result)</code>](https://i.stack.imgur.com/DxHDB.png)](https://i.stack.imgur.com/DxHDB.png)

I tried using an `apply` but I don't think this is the right way of doing things (on top of not working...):

```
def get_features(row):
    for column in row.colums:
        print(column.name)

df.apply(lambda row: get_features(row))

```

What would be the correct way to approach this?