1
在previous question合併DataFrames,我是問如何從這個數據幀source
匹配值:與排序標準
car_id lat lon
0 100 10.0 15.0
1 100 12.0 10.0
2 100 13.0 09.0
3 110 23.0 08.0
4 110 13.0 09.0
5 110 12.0 10.0
6 110 12.0 02.0
7 120 11.0 11.0
8 120 12.0 10.0
9 120 13.0 09.0
10 120 14.0 08.0
11 130 12.0 10.0
,只保留那些COORDS在這第二個數據幀coords
:
lat lon
0 12.0 10.0
1 13.0 09.0
但這一次我想匹配每個car_id
誰得到:
-
個
- 都具有相同的順序
的從coords
result
是: car_id
1 100
2 120
# 110 has all the values from coords, but not in the same order
# 130 doesn't have all the values from coords
有沒有辦法在一個量化的方式來實現這一結果,避免經歷了很多循環和條件?
什麼是這個答案原來的DF? –