i want to change 10 to 5 in index 0 and column name 'x'. my code is:
mydata = {'x' : [10, 50, 18, 32, 47, 20], 'y' : ['12', '11', 'N/A', '13', '15', 'N/A']}
df1 = pd.DataFrame(mydata)
df1['x'][df1['x'] == 10] = 5
and i got:
C:\Users\T\AppData\Local\Temp\ipykernel_2260\1154778325.py:1: SettingWithCopyWarning:
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
df1['x'][df1['x'] == 10] = 5
its work, but with this warning