I am trying to clean some data that I have. I want to replace )
with a blank space in specific rows which contain )
in a dataframe
.
Eg - 1948)
I have identified those rows which have the extra string character )
. I tried using str.replace
but it didn't seem to work.
movies['Year'].str[-1]==')'.replace(')','')
The code seems to run but doesn't clean the data.