s = (df.dtypes == 'object') object_cols = list(s[s].index) print("Categorical variables:") print(object_cols)