How to compare 2 Excel sheets and extract the common values?

  excel, pandas, python

Table I

c1 c2 c3
Ant Bee Apple
A B C
4 5 6

Table II

A1 A2 c3
G H Apple
H s C
8 asd 4

I would like to know if we can compare these 2 excel workbook (comparison based on the column c3) and extract only the similar values along with the entire row value of that matched value using Pandas

Expected Output:

c1 c2 c3 A1 A2
Ant Bee Apple G H
A B C H s

Source: Python Questions

LEAVE A COMMENT