pandas if column does not exist code example Example: check if column exists in dataframe if 'A' in df.columns: