I have a dataframe which has almost 70-80 columns. Each column consists of 100-150 rows in which values are stored as strings.
I would like to find, for each column, what is the number of common elements present in the rest of the columns of the DataFrame.
For example: say I have a dataframe like:
0 1 2 3
0 cat ox bull horse
1 lion dog cat zebra
2 bull ox horse tiger
3 horse eagle bull giraffe
Starting with first column, I need answer as 2,3 as 2 seems to have most number of common elements with the column 0 after that column 3 as it has comparatively less number of common elements.