for colname in df.columns: try: df[colname] = df[colname].astype('str') print(f"{colname} converted") except ValueError: print(f"{colname} failed")