for k,v in list(word_freq.items()): if v<4: del word_freq[k]注意:首先需要把字典的item转化成list才可以,否则会报错:RuntimeError: dictionary changed size during iteration
for k,v in list(word_freq.items()): if v<4: del word_freq[k]注意:首先需要把字典的item转化成list才可以,否则会报错:RuntimeError: dictionary changed size during iteration