How to check if a column exists in Pandas September 13, 2022 by Tarik This will work: if 'A' in df: But for clarity, I’d probably write it as: if 'A' in df.columns: