How to search for duplicates and then highlight them in a dataframe just like excel (worksheets in that case) does?

  duplicates, highlight, pandas, python

I want to highlight some values into a dataframe. I need to compare 2 columns on different dataframes (df1 and df2) then highlight the values that are duplicated and show them inside the first dataframe, df1.

To give you and idea, in excel you can achive this by using a countif formula, here is a video:

There’s any way to do this with pandas? or python in general.


Source: Python Questions