我有两个文件,例如
- Excel
ID | 价格 | 状态 |
---|---|---|
1 | ||
2000 | 选项 | |
3000 | 保留 |
您可以使用pandas
进行以下操作:
from pandas.testing import assert_frame_equal
df1 = pd.read_excel("your excell file path")
df2 = pd.read_json("your json file path") # or you can create using pd.DataFrame.from_dict(your_dict)
assert_frame_equal(df1, df2) # this will check if two dataframes are equal or not