我正在用逗号编写包含要使用Excel的句子的逗号。
lists = [sent for sent in doc.sents if ',' in sent.string.lower()]
发现,我可以在excel中返回True或False。
=ISNUMBER(SEARCH(",", A1))
我使用以下代码提取句子并将其列为excel中的行
sentences = [sent.string.strip() for sent in doc.sents]
预期:
Sentence IS_comma_sent
This sentence contains no comma. False
There is a , in this sentence. True
有关在熊猫中如何做的任何建议。