Prompt:

"Write Python code to compare two datasets and highlight rows with differences."

Output:

df1 = pd.DataFrame({'A': [1, 2, 3], 'B': [4, 5, 6]}) df2 = pd.DataFrame({'A': [1, 2, 4], 'B': [4, 5, 7]})

diff = df1.compare(df2) diff

Output Explanation: A DataFrame showing differences between two datasets row-by-row.