Pandas `to_csv` String column got converted
CSV doesn't have data types.  Excel has no way of knowing what you want, so it tries to interpret it.  If you are using Excel, click the data tab and 'from csv' and you can specify dtypes on reading it.
Otherwise open the csv file in notepad and you'll see that the data is there.
I have a dataframe with a column of user ids converted from int to string
df['uid'] = df['uid'].astype(str)
However when I write to csv, the column got rounded to the nearest integer in format 1E+12 (the value is still correct when you select the cell).
But to_excel outputs the column correctly, can someone explain a bit?
Thank you!