Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- id data
- 135790075 job done, pay by card 4444-5555-6666-7777
- data = pd.read_csv("sample.csv")
- summ = data['summary']
- creditcards = []
- regex_match_index_list =[]
- Validcardsfound = 0
- regex_count = 0
- for i in range(2):
- temp = re.findall(r'(dB(?:d[ -]*?){13,16}b)',str(values[i]))
- if temp:
- for each in temp:
- regex_count = regex_count + 1
- if doLuhn(str(each)) is True:
- creditcards.append(each)
- Validcardsfound = Validcardsfound + 1
- regex_match_index_list.append(i)
- #else:
- # pass
- elif doLuhn(str(temp)) is False:
- pass
- else:
- pass
- rows =[]
- for each in regex_match_index_list:
- changed = data.iloc[each].str.replace(r'(dB(?:d[ -]*?){13,16}b)', r'(xxxx-xxxx-xxxx-xxxx')
- # print("Changed", changed)
- rows.append(changed)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement