之間我有2個非索引數據幀,具有完全相同的數據結構(同一列),爲簡單起見在這裏是一個例子:大熊貓:數據差(△)2個數據幀
DF1
0 1 2 3 4
JoeK Joe Kavanagh 120 [email protected]
BarryD Barry Dempsy 11 [email protected]
OrlaF Orla Farrel 236 [email protected]
SethB Seth Black 563 [email protected]
KateW Kate White 254 [email protected]
,第二個:
DF2
0 1 2 3 4
JoeK Joe Kavanagh 110 [email protected]
BarryD Barry Dempsy 11 [email protected]
JimmyS Jimmy Smith 250 [email protected]
SethB Seth Blake 563 [email protected]
我想有一個RESU lting表示DF1不在DF2行dataframes:
0 1 2 3 4
JoeK Joe Kavanagh 120 [email protected]
OrlaF Orla Farrel 236 [email protected]
SethB Seth Black 563 [email protected]
KateW Kate White 254 [email protected]
注意,第一行(Joek,和SethB)在兩個dataframes存在,但第3列的用於JoeK值和列的值2的SethB已經改變了,這就是他們進入最終結果集的原因。
任何幫助,非常感謝。
你的結果不應該只是'df1',因爲電子郵件不符合第二行嗎?或者你的限制只是在第0-3列上匹配? – EdChum
那麼斑點,那是一個錯字。我現在糾正了它。 –