Pandas DataFrame allows you to store data in the form of rows and columns. Sometimes you need to manipulate this data for effective analytics. Also, sometimes you may need to set the value of particular cell using index.
Here, Index refers to the number of rows which ranges from 0 to n-1.
To set the value of a particular cell using index, you should use the following property:
Syntax:
DataFrame.at['index','column_name']
pandas.DataFrame.at Property
The at property is used to find the position of a cell value. It takes two arguments; Index number and column name and it returns the respective cell value. This method can also be used to set the value of a particular cell.
To work with Python Pandas, we need to import the pandas library. Below is the syntax,
import pandas as pd
Example:
Output:
need an explanation for this answer? contact us directly to get an explanation for this answer