dropping duplicate rows in pandas stack code example Example: remove duplicate columns python dataframe df = df.loc[:,~df.columns.duplicated()]