the image is a part of a data frame with the title, author, text_reviews_count and the ratings_counts about the book. The data frame is grouped by the author column.
Asked
Active
Viewed 59 times
1
-
This results in the total frequency count for the author. I need to calculate the sum of all the values in the text_reviews_count column for a single author. For eg - Agatha Christie is mentioned 69 times in this data frame, so I have to calculate the total of the text_reviews_counts for all those 69 instances. – Surabhi Jaiman Jul 16 '19 at 16:41
-
1Please produce a [mcve] and edit your question appropriately. The way in which you've presented your question makes it difficult for others to help. This makes your question less useful. If you follow my advice, I'm sure someone will help you. – piRSquared Jul 16 '19 at 16:43
1 Answers
0
In this example, I named your data frame Book_Dataframe since I didn't have much to work with.
Book_Dataframe = Book_Dataframe.groupby(['Author'](['text_reviews_count'].sum().reset_index()
Book_Dataframe = Book_Dataframe[Book_Dataframe['Author'] == 'J.K. Rowling']
Book_Dataframe.head()

MBA Coder
- 374
- 1
- 3
- 13