change dataframe column to string code example
Example 1: pandas change column to a string
total_rows['ColumnID'] = total_rows['ColumnID'].astype(str)
Example 2: in dataframe particular column to string
df["fruit"] = df["fruit"].astype("|S")
total_rows['ColumnID'] = total_rows['ColumnID'].astype(str)
df["fruit"] = df["fruit"].astype("|S")