how to check if column exists in dataframe python code example
Example 1: check if column exists in dataframe
if 'A' in df.columns:
Example 2: find nan value in dataframe python
# to mark NaN column as True
df['your column name'].isnull()
Example 3: pandas check if value in column is in a list
df_new[df_new['l_ext'].isin([31, 22, 30, 25, 64])]
Example 4: check if column exists in dataframe python
if 'A' in df: