Set value for particular cell in pandas DataFrame using index

RukTech’s answer, df.set_value(‘C’, ‘x’, 10), is far and away faster than the options I’ve suggested below. However, it has been slated for deprecation. Going forward, the recommended method is .iat/.at. Why df.xs(‘C’)[‘x’]=10 does not work: df.xs(‘C’) by default, returns a new dataframe with a copy of the data, so df.xs(‘C’)[‘x’]=10 modifies this new dataframe only. … Read more