delete a column based on if exists or not python code example Example: is coumn exist then delete in datafrmae if 'A' in df.columns: del df['A']