re.sub tag

3 questions


1 answers
43 views
0
I have a question about removing special characters from Python.

pattern='[\W]'text = re.sub(pattern, ' ', text)I don't want to remove the word 'as in isn'taren't it's, but what can I do?ㅠ

2 years ago

1 answers
42 views
0
Re.sub question

import globimport shutilimport osimport redirs = ['DataGathering']for dir in dirs: file_names = glob.glob(os.path.join(dir,'*'))file_names = [os.path.basename(name) for name in file_names] if not os.p...

2 years ago

1 answers
46 views
0
Python dataframe re.sub Post a question.

The API information is being preprocessed using a data frame.In order to eliminate useless text, re.subfunction was used as below.import reimport pandas as pdregex = \(.*\)|\s-\s.*df = pd.dataframe(re...

2 years ago

© 2024 OneMinuteCode. All rights reserved.