0

I have a pandas DataFrame and I want to update a particular cell value (adding a fix number, like 10), like this:

df['A'].iloc[0] = df['A'].iloc[0] + 10

Which is the best way to achieve this goal avoiding the

SettingWithCopyWarning:
A value is trying to be set on a copy of a slice from a DataFrame
Laura
  • 1,192
  • 2
  • 18
  • 36
  • https://stackoverflow.com/questions/20625582/how-to-deal-with-settingwithcopywarning-in-pandas – BENY Jul 01 '19 at 18:03

1 Answers1

0

You can try:

df.loc[0, 'A'] = df.loc[0, 'A'] + 10
René
  • 4,594
  • 5
  • 23
  • 52