Created
June 20, 2016 14:37
-
-
Save lmEshoo/61f36e922b26d7cfaacd0194e733cfed to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
#change the name of ex1 to the master | ex2 to slave | |
df1 = pd.ExcelFile("ex1.xls").parse("Sheet1").set_index("number") | |
df2 = pd.ExcelFile("ex2.xls").parse("Sheet1").set_index("number") | |
a1, a2 = df1.align(df2) | |
different = (a1 != a2).any(axis=1) | |
comp = a1[different].join(a2[different], lsuffix='_master', rsuffix='_slave') | |
comp.to_excel("comp.xls") | |
print comp |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment