In Panda DataFrames in python, replacing values by column and index is very straight-forward.
Example DataFrame:
df = pd.DataFrame({'A': [1, 2, 3], 'B': [200, 300, 400]})
A B
0 1 200
1 2 300
2 3 400
Replacing values is as simple as:
df['A'][0] = 800
A B
0 800 200
1 2 300
2 3 400
How do you replace value by column and index in a Danfo DataFrame ?
Please try:
You probably noticed, but just in case, 1 here is the value not the index.
Official documentation
{replace: int, float, str. The value to replace. with: Int, float, str. The new value to replace with. in: Array. An array of column names to replace, If not specified, replace all columns. }
https://danfo.jsdata.org/api-reference/dataframe/danfo.dataframe.replace