【发布时间】:2021-06-22 07:58:11
【问题描述】:
我有两个数据集 data1 和 data2
在 data1 列中是 lat long locationid1 和 countrycode
在 data2 列中是 lat long locationid2。
我写了类似
的代码
if locationid2!=None and len(locationid2)>0 and str(locationid2)!='nan' and locationid2 in list(data["locationid1"]):
macth={真}
但是在这里我想在matching.like中添加国家代码..如果locationid1具有coluntrycode =“GB”那么只有它与locationid2匹配 数据1
预期输出
【问题讨论】:
-
您能否编辑您的问题并在那里发布小输入数据框和预期输出? (格式正确)
标签: python python-3.x list dataframe