Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions 1-Data-Cleaning.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -284,9 +284,9 @@
"def clean_text_round1(text):\n",
" '''Make text lowercase, remove text in square brackets, remove punctuation and remove words containing numbers.'''\n",
" text = text.lower()\n",
" text = re.sub('\\[.*?\\]', '', text)\n",
" text = re.sub('[%s]' % re.escape(string.punctuation), '', text)\n",
" text = re.sub('\\w*\\d\\w*', '', text)\n",
" text = re.sub(r'\\[.*?\\]', '', text)\n",
" text = re.sub(r'[%s]' % re.escape(string.punctuation), '', text)\n",
" text = re.sub(r'\\w*\\d\\w*', '', text)\n",
" return text\n",
"\n",
"round1 = lambda x: clean_text_round1(x)"
Expand Down Expand Up @@ -508,7 +508,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.2"
"version": "3.12.2"
},
"toc": {
"nav_menu": {},
Expand Down