Skip to content
Advertisement

extract values into new column for each unique values in another column

I have a dataframe and a sample of it looks like this

JavaScript

df

I would like to extract the review_id into a list for each word in indo column such that the output would be something like this output2

I tried the following code but it does not work as it returns the review_id of all counts that are more that one which may or may not be the same words in the indo column.

JavaScript

Any suggestions / code I can use? Thank you!

Advertisement

Answer

if you share the data, I can reproduce and add the result

This hopefully will answer your question

JavaScript
JavaScript
User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement