How to add leading zeros to a int column in a data frame. I have an int column which has the time values in the format HHMMSS. Some of the time values which are after 12am have two digits. i.e 30 is supposed to be 0030, 45 is supposed tp be 0045. How do I add leading zeros to the below column
ColumnName
100012
225434
30
45
36
80200
Expected result
ColumnName
100012
225434
0030
0045
0036
80200
I tried the below code using pandas in python but it's not working
str(df.ColumnName).zfill(4)
I also tried
if(len(str(df.ColumnName))==2)
str(df.ColumnName).zfill(4)