I am trying to +1 to a cell in pandas dataframe
staff['pax'][0]= staff['pax'][0]+1
staff is the dataframe name, pax is the column name while 0 is the row I want to +1. However below is the error..
A value is trying to be set on a copy of a slice from a DataFrame
See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy
staff['pax'][j]= staff['pax'][j]+1
C:\Mentor_Engine\test.py:53: SettingWithCopyWarning:
A value is trying to be set on a copy of a slice from a DataFrame
I think the code is trying to copy the cell instead of +1 to the value in the cell, anyone could advise on how should I do it?