0
Doubt in replace in dataframe pandas
texto = 'Vírus de computadores são uma lenda urbana.'
dado = {'texto': [texto]}
df = pd.DataFrame(dado)
df['nova_coluna'] = df.texto.str.replace('urbana', '')
By creating this new column we can buy that the word 'urban' has been retained
but if you put that expression inside the is not right
palavras = 'computadores', 'uma', 'lenda'
for palavra in palavras:
df['nova_coluna'] = df.texto.str.replace(palavra, '')
is created by column but words are not exchanged