Matching characters or numbers

strinfo=re.compile(r'([\u4e00-\u9fa5]|[\d])')
df['label']=df['data'].apply(lambda x:strinfo.sub('',x))


strip_ = re.compile (r '([ ,] | [.] | [:] | [,])') 
brackets symbols not need to add the quotes

 

 

Guess you like

Origin www.cnblogs.com/jfdwd/p/11458331.html