I am trying to rename a column of a Dataframe but it is giving me a warning (SettingWithCopyWarning: A value is trying to be set on a copy of a slice from a DataFrame).
I have a dataframe with only two columns, 'u_id' (int64) and 'scores'(float64). My code looks like this:
df = df_scores.rename(columns = {'u_id': 'user_id'}, inplace = True)
I can't find a solution in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy
The command worked completely fine a few weeks ago but is not working now. Can anyone please help?