'NPL: Generate a New Column who shows the Most Relevant Word of the Comment Column Pandas
I have the following DataFrame: Sample Database
As you can see, I have a column that is cancel comments (the column is in Spanish because I'm analyzing Spain) and other one who is the number of appearences. This database goes by till 900 comments, so I have a lot of comments and few appearences.
What I want to do, is generate a new column that take the most important or recurrent word in the cancel comments columns so I can group by the most important o recurrent words and have more number of appearences.
For example (I selected the word just looking at the most recurrent one),
So then I can group by and have less appearences:
So my issue is how to get that unique word (that should be the most relevant of the sentence) so I can group by the comments and have less appearences.
Edit: What I think and I don't know to code, is to count the appearences of each words and give them value. First word of appearences should be 100, second 99, etc. So when the system select the most important word of the sentences, he just show the word with highest value. I don't know if it's the best way, but is the only one I think.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
