W3docs

How can I get a value from a cell of a dataframe?

You can use the .at or .iat methods to get the value of a specific cell in a DataFrame.

You can use the .at or .iat methods to get the value of a specific cell in a DataFrame.

Here's an example:

Get a value from a cell of a Pandas DataFrame in Python using the at method

python— editable, runs on the server

<div class="alert alert-info flex not-prose"> Watch a course <span class="hidden md:block">Watch a video course </span> Python - The Practical Guide</div>

You can also use the .iat method if you want to access the cell by its index rather than by its label:

Get a value from a cell of a Pandas DataFrame in Python using the iat method

value = df.iat[0, 0]
print(value)

Both .at and .iat will return the value of the cell at the specified row and column.