Closed
Description
e.g. columns with values like 01001
are getting converted to int
example from mailing list:
df = read_csv('test_data.csv')
df.head()
oid did mode ox oy dx dy
0 1001 1001 01 272311.659358 176751.822655 272675 176375
1 1001 1001 01 272311.659358 176751.822655 272375 176375
2 1001 1001 01 272311.659358 176751.822655 272125 176675
3 1001 1001 06 272311.659358 176751.822655 272675 177125
4 1001 1001 06 272311.659358 176751.822655 272675 176375
df.oid = df.oid.apply(lambda x: str(x).zfill(5))
df.head()
oid did mode ox oy dx dy
0 01001 1001 01 272311.659358 176751.822655 272675 176375
1 01001 1001 01 272311.659358 176751.822655 272375 176375
2 01001 1001 01 272311.659358 176751.822655 272125 176675
3 01001 1001 06 272311.659358 176751.822655 272675 177125
4 01001 1001 06 272311.659358 176751.822655 272675 176375