Python Forum
Help with Data Match Theory
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help with Data Match Theory
I am newer to Pandas in Python, and I have a bit of a problem in that I cannot seem to wrap my head around how to do this task:

I have 2 DataFrames
df2018 and df2019

I need to take each row in df2019 and look to see if the "idn" in df2019 matches any "idn" in df2018, if there is NO MATCH, then, i need to create a 3rd df and place the row from 2019 into the new df.

I tried this, but it leaves the new df empty..

df2018 = pd.read_excel (r'C:\Users\User\Downloads\xxx2018.xls')
df2019 = pd.read_excel (r'C:\Users\User\Downloads\xxx2019.xls')

df3 = df2019[df2019['idn'].isin(df2018['idn']) == False]

Thank you for any help..
you can use Set Theory symmetric difference
Thank you Larz60+

I see, as per your assistance that i was close but it was a grammatical error.

Possibly Related Threads…
Thread Author Replies Views Last Post
  .xls processing with Pandas - my struggle moving from theory to practical use prolle 0 1,147 May-21-2020, 06:57 PM
Last Post: prolle
  Time Data does not match format AshBax 2 27,628 Nov-13-2018, 12:19 PM
Last Post: AshBax
  Match two data sets based on item values klllmmm 7 5,359 Mar-29-2017, 02:33 PM
Last Post: zivoni
  From theory to practice bertibott 12 10,268 Feb-25-2017, 12:10 AM
Last Post: sparkz_alot

Forum Jump:

User Panel Messages

Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020