I have a df in Python with an ID column - those IDs can be a mix of numbers and letters, or solely numbers. Eg:
ID |
---|
00028D9D1 |
00027B98F |
000275457 |
When I save this df out, using pandas to_csv
I see in the resulting csv file when I share with others (or open up myself), I see the IDs that contain letters are maintained as is / treated as text, but the IDs that are solely numbers are treated as integers, and automatically formatted that way. For example, I would see this in my csv file after saving:
ID |
---|
00028D9D1 |
00027B98F |
275457 |
Is there any way to disable this automatic treatment of integers, leading to different formatting? The dtype
of this column does say it is an object
so I assumed it would save in the same format for all values.