I have a dataframe of survey responses with 'Yes/No' responses. I would like to create a new column/variable that is the total number of Yes responses.
I could replace all the 'Yes/No' to '1/0', then use:
df['total_variable'] = df.iloc[:, 16:22].sum(axis=1)
Or I could write a for loop.
But I was just wondering if there are any other efficient ways of doing this?