this question the reverse problem as In Python, how to specify a format when converting int to string?
here I have string "0001" to integer 1
string "0023" to integer 23
I wish to use this on pandas dataframe since I have column looks like:
dic = {'UPCCode': ["00783927275569", "0007839272755834", "003485934573", "06372792193", "8094578237"]}
df = pd.DataFrame(data=dic)
I wish it become some thing like this
dic = {'UPCCode': [783927275569, 7839272755834, 3485934573, 6372792193, 8094578237]}
df = pd.DataFrame(data=dic)
if I use int(001) or float(0023) it will gives me this error
SyntaxError: leading zeros in decimal integer literals are not permitted; use an 0o prefix for octal integers