remove column which are the same pandas code example Example: python - remove columns with same name and keep first df1 = df.loc[:, ~df.columns.duplicated()]