【发布时间】:2019-08-12 21:12:43
【问题描述】:
我想重写 SSN # 以便将前五个数字替换为星号
这是 csv 文件的外观:
Emp ID,Name,DOB,SSN,State
15,Samantha Lara,1993-09-08,848-80-7526,Colorado
这是预期数据的样子:
15,Samantha,Lara,09/08/1993,***-**-7526,CO
这是我到目前为止的代码,但不确定如何屏蔽这些数字
# create a list to store the data from csv file
empl_ssn = []
reform_ssn = row["3"]
reform_ssn = ........
【问题讨论】:
标签: python regex python-3.x csv