Python Forum

Full Version: Dataframe replace
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
i have a dataframe that has rows like. i want to get rid of various markings like =, |, ()

i wrote this but it returns the same value without removing

['2 team name = 27.92 4 0 0 20.25( 18) 0 0 0 | 1 0 0 | 27.03 2 | 28.55 2 | 28.35 2 (region west)']

df.replace(to_replace=[ '|', '(' ,')' ,'=' ], value='')