I used read_csv()
to load a dataset that looks like this
userid
NaN
1.091178e+11
1.137856e+11
I want to convert the user ids to string. One solution is to add keep_default_na=False
to read_csv()
, which is suggested by this SO: Converting long integers to strings in pandas (to avoid scientific notation)
Let's say I don't want to use keep_default_na=False
. Is there any way to convert the user id column to str.
I tried df.userid.astype(str)
and I got 1.091178e+11
back. I was expecting the result in the expanded form not scientific form.
What should I do?