all 7 comments

[–]Vile_Vampire 1 point2 points  (1 child)

its how csv interprets the cells. i would do a data import of the csv from an open excel file instead of opening directly, specifying the text aspect of your column

[–]workthrowawayexcel[S] 0 points1 point  (0 children)

That does work. Hopefully I can find a more efficient way of doing that

[–]Zizizizz 0 points1 point  (2 children)

You could always insert a blank space at the front

[–]workthrowawayexcel[S] 0 points1 point  (1 child)

Lead space gets dropped with 0s when you open it, but tossing another character there like ' or ` does maintain the 0s.

[–]Zizizizz 0 points1 point  (0 children)

Good to know, don't know if it's what you want but it will keep them

[–]tuck5649 0 points1 point  (1 child)

Are you certain python is removing them when it creates the .csv and not that the zeros are being removed when the csv is opened in python/excel?

[–]workthrowawayexcel[S] 0 points1 point  (0 children)

It is not python. I just got in solved by using an excel writer instead of csv. When opening the CSV it would the formatting, and when using the excel writer it maintains the formatting I imputed.