问题描述
我希望从数据帧中单独提取“ GTIN”列,并将每个行号转换为14位数字。最终答案应是一个序列,每列14位数字均来自GTIN
# extracting non duplicates gtin and cinverting to a new data frame
gtin=df.drop_duplicates(subset=[2])
gtin=gtin.rename(columns={2:'GTIN'})
gtin=gtin['GTIN']
type(gtin['GTIN'])
#checking if gtin is less than 14 digits,if less add zeros at beginning to search in sql query
for number in gtin:
gtin[0].str.zfill(14)
我尝试了上述方法,但是答案仍然不变,即无法将12位数字转换为14位数字。
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)