df['id'] = df['id'].astype("string") df['id'] = pandas.Series(df['id'], dtype="string") df['id'] = pandas.Series(df['id'], dtype=pandas.StringDtype)