我正在对笔记本中的非结构化数据进行一些分析,这些数据包含一列信息。我想把这个专栏拉出来,进行自然语言处理,看看哪些关键字最常见,哪些是标记化。
当我在用户评论栏上应用我的word标记器时,我要分析的文本:
text = df.loc[:, "User Reviews"]
行号包含在文本“用户评论”列中。
由于一些用户评论包含与行号相同的数字,这对于分析来说变得很混乱,尤其是因为我正在应用标记化并查看术语频率。因此,在下面的示例中,行从1开始,然后2是下一行,然后是3,以此类推,用于10K用户评论。
['1', 'great', 'cat', 'waiting', 'on', 'me', 'home', 'to', 'feed', 'love', 'fancy', 'feast',
'2', 'my', '3', 'dogs', 'love', 'this', '3', 'So', 'bad', 'my', '4', 'dogs', 'threw', 'up', ...]
有没有办法做到这一点?我需要吗
text.drop
放弃这一行?我在这里查阅了一些资料:
https://www.shanelynn.ie/using-pandas-dataframe-creating-editing-viewing-data-in-python/
https://medium.com/dunder-data/selecting-subsets-of-data-in-pandas-6fcd0170be9c
但我仍在努力。
User Reviews
0 i think my puppy likes this. She seemed to keep...
1 Its Great! My cat waiting on me to feed her. Fa...
2 My 3 dogs love this so much. Wanted to get more...
3 All of my 4 dogs threw this up. Wouldnt ever re...
4 I think she likes it. I gave it to her yesterda...
5 Do not trust this brand, dog died 3 yrs ago aft...
6 Tried and true dog food, never has issues with ...