Desire format:
CODE: "0700.1707300","2700.1707380","0060.1500000","3400.1600215"
Dataset:
dt = pd.DataFrame({"CODE":
["700.17073","2700.170738","60.150","3400.1600215"}) # dtype('float64')
Example:
IN: '{:012.7f}'.format(700.17073)
OUT: '0700.1707300' <-- return desire format
Problem:
CODE.rjust,CODE.ljust
convert only one part before / after decimal of the index.
OR
Getting error by this script :
dt["CODE"].loc[dt["CODE"].'{:012.7f}'.format()]
In R data.table:
dt[,CODE:=formatC(as.numeric(CODE), format = 'f', width = 12, flag = '0', digits = 7)] <-- can achieve by formatC
How to update this column from dtype('float64')
into desire formatting?