texts=[[word for word in document.lower().split() if word not in stoplist] for document in documents]
这段代码等同于:
texts=[] for document in documents: words=[] for word in document.lower().split(): if word not in stoplist(): words.append(word) texts.append(words)
原文:https://www.cnblogs.com/zyber/p/9594051.html