python只取某兩列 python兩個列表要怎么匹配數(shù)據(jù)?
python兩個列表要怎么匹配數(shù)據(jù)?匹配兩個列表數(shù)據(jù)可以通過取兩個列表的交集來完成。例如:a=[2,3,4,5]B=[2,5,8]TMP=[Val For Val in a if Val in B]T
python兩個列表要怎么匹配數(shù)據(jù)?
匹配兩個列表數(shù)據(jù)可以通過取兩個列表的交集來完成。例如:
a=[2,3,4,5
]B=[2,5,8
]TMP=[Val For Val in a if Val in B
]TMP[2,5]