【发布时间】:2020-10-28 16:12:35
【问题描述】:
这个问题很简单。我想知道如何获取包含字符串的列表(行)的数量,该字符串存在于至少一个列表(行)中,其中我的数据以列表列表的形式存储,每个子列表包含字符串。我检查了这个(How to select the rows that contain a specific value in at least one of the elements in a row?),但我的数据不是数据框的形式,我没有足够的声誉点来评论那里。
我的数据如下所示:
[['this', 'is', 'the', 'first', 'document'], ['this', 'document', 'is', 'the', 'second', 'document'], ['and', 'this', 'is', 'the', 'third', 'one'], ['is', 'this', 'the', 'first', 'document']]
【问题讨论】:
标签: python python-3.x string list