Remove Punctuation
Libraries¶
In [9]:
import string
Create a document¶
In [10]:
documents = ["this isn't a sample.",
'this is another example.' ,
'this" also appears in the second example.'
'Is this an example?']
documents
Out[10]:
Remove Punctuation¶
In [11]:
table = str.maketrans('', '', string.punctuation)
doc_removed_punctuation = [w.translate(table) for w in documents]
doc_removed_punctuation
Out[11]:
Comments
Comments powered by Disqus