check duplicate columns pandas code example
Example 1: print duplicates elements in column pandas
mask = df.columnname.duplicated(keep=False)
print (df[mask])
Example 2: remove duplicate columns python dataframe
df = df.loc[:,~df.columns.duplicated()]