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