Link to home
Start Free TrialLog in
Avatar of Newton
Newton

asked on

Python compare dataframe columns.

Hi,
I have 2 files. I want to compare these 2 files and select only those that doesn't match.

For example, my 2 source files are File 1 : CountryA.txt
fruits|count
apple|100
orange|200
grapes|230

File 2 : CountryB.txt
fruits|count
apple|20
orange|15
peach|20

I need below 2 outputs
Output1.txt
fruits|count
grapes|230

Output2.txt
fruits|count
peach|20

I am trying to use outer join concept but it is not working. What is correct way of doing this ?
ASKER CERTIFIED SOLUTION
Avatar of Subodh Tiwari (Neeraj)
Subodh Tiwari (Neeraj)
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Newton
Newton

ASKER

Thanks Neeraj. my problem solved.
Great. You're welcome!