我需要将df1中的机场名称与df2中的lat和lng匹配
我试过使用join和groupby,但效果不错
df1:
name code lat lng
temp0 a1 3.2 121.9
temp1 a2 4.9 151.6
temp2 b1 6.7 125.3
df2:
city lat lng admin nearest_airport_lat nearest_airport_lng
city 1 4.7 132.6 admin1 4.9 151.6
city 2 5.1 142.9 admin1 6.7 125.3
city 3 2.2 110.4 admin1 3.2 121.9
预期产出:
city lat lng admin nearest_airport_lat nearest_airport_lng airport
city 1 4.7 132.6 admin1 4.9 151.6 temp1
使用合并
相关问题 更多 >
编程相关推荐