I am trying to update missing values in a column in a pandas
dataframe, but am getting a warning about the method. When I change to the suggestion, I still get the same error. What can I do to not get yelled at by pandas?
First attempt:
df['column1'].fillna(inplace=True, value='Low')
First response:
/usr/local/bin/python3.5/site-packages/pandas/core/indexing.py:3295: SettingWithCopyWarning:
A value is trying to be set on a copy of a slice from a DataFrame.
Try using .loc[row_indexer,col_indexer] = value instead
Second attempt:
df.loc[df['column1'].isnull(), 'column1'] = 'Low'
Second response:
/usr/local/bin/python3.5/site-packages/pandas/core/generic.py:476: SettingWithCopyWarning:
A value is trying to be set on a copy of a slice from a DataFrame