Blocking Seven Digit Numbers In String Pandas
Background I have the following sample df import pandas as pd df = pd.DataFrame({'Text':['This person num is 111-888-8888 and other', 'dont block 23 here'
You can try this regex expression. ((?:[\d]-?){7,})
Final block of code is this
df['New_Text'] = df['Text'].str.replace(r'((?:[\d]-?){7,})','**Block**')
Post a Comment for "Blocking Seven Digit Numbers In String Pandas"