maxharlow/csvmatch

Ignore_letters option

Closed this issue · 1 comments

For the purpose of matching strings with helpful numbers and unhelpful words (such as precinct names with codes and messy names), adding an "ignore_letters" option would be nice. This would only match numbers from two columns of interest.

I implemented something like this in my code with:

def ignore_alpha(row):
    regex = re.compile('[\D_]+')
    return [regex.sub('', value) for value in row]

This can be achieved with the Regex ignore function