How can I combine all the tokenized words into a sentence in a column?
tokenized_word = ['really','smart','people']
in a sentence = really smart people
How can I combine all the tokenized words into a sentence in a column?
tokenized_word = ['really','smart','people']
in a sentence = really smart people
There is a standard join
operation in Python:
sentence = ' '.join(tokenized_word)
If you want to convert it to Pandas column, you can do it like this:
`df['col_name'] = sentence
def remove_punctuation(txt):
txt_nopunt = " ".join([c for c in txt if c not in string.punctuation])
return txt_nopunt
data['tokenized_word'] = data['tokenized_word'].apply(lambda x: remove_punctuation(x))