Categories
Python Answers

How to set value for particular cell in Python Pandas DataFrame using index?

Spread the love

To set value for particular cell in Python Pandas DataFrame using index, we can use the set_value method.

For instance, we write

df.set_value('C', 'x', 10)

to set the value of the 'C‘ column in 'x' row of the df data frame to 10.

By John Au-Yeung

Web developer specializing in React, Vue, and front end development.

Leave a Reply

Your email address will not be published. Required fields are marked *