how to index directly into dataframe and change the value code example
Example 1: change dataframe value by index
x y
A NaN NaN
B NaN NaN
C NaN NaN
df.at['C', 'x'] = 10
Example 2: how to change index in dataframe python
index = [1,2]
df.index = index