I wrote a function to eliminate spaces of a value in my dataframe.
def eliminate_space(words):
return words.replace(' ', '')
Now I want to apply that function to each row in my 'words' column of my dataframe.
df['words']=df['words'].apply(eliminate_space(words))
It's saying the name 'words' is not defined. How do I adjust my code to be able to apply the function to each value in that column of my dataframe?