Suppose we have a data frame df
like
book_id book_category book_word_hi book_word_bye book_word_yes
1 drama 3 0 4
2 action 1 4 5
3 drama 5 3 2
I would like to count the number of values within the book_word
columns and sum them in a table for each book_category
.
So the output here should look something like:
drama: 17
action: 10
Does anyone know how to do this?