I have a df
review review_id word_count
['abc def', 'ghi'] [1, 2] [2, 1]
['jkl mno pqr', 'stu', 'vwx'] [3, 4, 5] [3, 1, 1]
For each row in the df, I would like to create new columns for review and review_id whereby there will only consist of the review/review_id with the maximum word count. Thus, the output should look something like this.
review review_id
abc def 1
jkl mno pqr 3
I can only think of getting the index of the max value in word_count. Any sugeestions will be welcomed. Thanks!