2024-10-02 18:17:00 发布
网友
请建议如何比较2个bigram列表并仅返回匹配的bigram。 从下面的示例列表中,如何返回匹配的bigram['two','three']
bglist1 = [['one', 'two'], ['two', 'three'], ['three', 'four']] bglist2 = [['one', 'six'], ['two', 'four'], ['two', 'three']]
您可以只测试这个二元图是否在另一个二元图列表中
out = list() for x in bglist1: if x in bglist2: out.append(x)
这将为您提供两个bglists中的列表列表
您可以只测试这个二元图是否在另一个二元图列表中
这将为您提供两个bglists中的列表列表
相关问题 更多 >
编程相关推荐