I have a dataframe and one of the columns is a city name. To check if I have duplicates values I make a df_hotels['city_name'].value_counts().sort_values
. When I display the results I can see that I have duplicates values because of an empty character on the left of some cities.You can check that. (normaly I have a count of 25 for each line)
The problem is that when I try to make a df_hotels['city_name'] = df_hotels['city_name'].str.strip()
(or lstrip) it doesn't work, the empty character on the left is still there.
FYI a to give the context : the column type is a object and I have created the dataframe form a json with a simple pd.read_json.
Thanks for you help.