I have a dataframe, and a list of strings that I want to remove from a column in that dataframe. But when I use the replace function those characters remain. Can someone please explain why this is the case?
bad_chars = ['?', '!', ',', ';', "'", '|', '-', '--', '(', ')',
'[', ']', '{', '}', ':', '&', '\n']
and to replace:
df2['page'] = df2['page'].replace(bad_chars, '')
when i print out df2:
for index, row in df2.iterrows():
print( row['project'] + '\t' + '(' + row['page'] + ',' + str(row['viewCount']) + ')' + '\n' )
en (The_Voice_(U.S._season_14),613)