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