思路:新增一列,直接用字符串G+身份证号码
import pandas as pd path = "stus.xlsx" df = pd.read_excel(path, names=['班级','姓名','性别','身份证号码'] #为了防止字段不规范,比如多空格等问题 ) df["N身份证号码"] = 'G'+df["身份证号码"]
标签:pd,号码,df,身份证,path,pandas,身份 From: https://www.cnblogs.com/scholarly/p/17003117.html