简体   繁体   中英

python print sentences with common word or frequency words?

i have a data set and i want print all sentences with most frequency word like:

example imagine i have this:

在此处输入图片说明 this is the frequency of my dataset

在此处输入图片说明

and this is my original dataset

i want print all sentences contain (i) and then delete those extract sentences from dataset

then start with (you) and print all the sentences that contain (you) and then delete (you)

but i want set the range between them example start from (frequency 600 to 100) not all of them how to do it

any idea how to do it ? my dataset is .txt

i tried this one :

If I understand this right, you want to do a for i in range() for some values from a txt file. I would suggest reading from the file into a dictionary {} so you can use key value pairs to determine when to stop checking.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM