Created
January 18, 2019 05:46
-
-
Save MLWhiz/cfc73813ee9663a7a52b5d749c7bb83d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def clean_numbers(x): | |
| if bool(re.search(r'\d', x)): | |
| x = re.sub('[0-9]{5,}', '#####', x) | |
| x = re.sub('[0-9]{4}', '####', x) | |
| x = re.sub('[0-9]{3}', '###', x) | |
| x = re.sub('[0-9]{2}', '##', x) | |
| return x |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment