使用Python的pandas库实现。首先,使用pandas的read_excel函数读取两个Excel文件并将它们存储为dataframe对象。然后,使用pandas的concat函数将两个dataframe连接起来并使用之前的index作为连接参考。接下来,使用pandas的duplicated函数找到完全重复的行并将它们从dataframe中删除。最后,使用pandas的drop_duplicates函数找到唯一的行并返回它们。示例代码如下:
import pandas as pd
# 读取Excel文件
df1 = pd.read_excel('file1.xlsx')
df2 = pd.read_excel('file2.xlsx')
# 连接两个dataframe
merged_df = pd.concat([df1, df2], ignore_index=True)
# 删除完全重复的行
merged_df.drop_duplicates(inplace=True, keep=False)
# 找到唯一的行并返回
non_common_rows = merged_df.drop_duplicates()
这段代码会比较file1.xlsx和file2.xlsx文件,并返回它们之间不同的行。最后,non_common_rows就是这些非相同行的集合。