У меня есть 2 кадра данных
Map3 = pd.DataFrame({
"partner_country": ["France","France","France","France","France","France",
"Spain","Spain","Spain","Spain","Spain","Spain"
],
"my_network": ["Ireland","Austria",None,"Sweden","Italy",None , #France
"Ireland","Austria","Denmark","Sweden",None,"United Kingdom" #Spain
]})#Netherlands
Map4 = pd.DataFrame({
"partner_country": ["France","France","France","France","France","France",
"Spain","Spain","Spain","Spain","Spain","Spain"
],
"my_network": [None,None,None,None,"Italy",None , #France
None,"Austria",None,"Sweden",None,"United Kingdom" #Spain
]})#Netherlands
Я хочу удалить все наблюдения, обычные для Map3 и Map4, из фрейма данных Map3. Попробовал следующий код:
Map4[~(Map4['partner_country'].isin(Map3['partner_country'])Map4['my_network'].isin(Map3['my_network']]