Python | Pandas Dataframe.iat[ ]
Python is a great language for doing data analysis, primarily because of the fantastic ecosystem of data-centric Python packages. Pandas is one of those packages and makes importing and analyzing data much easier.
Pandas iat[] method is used to return data in a dataframe at passed location. The passed location is in the format [poition in column, position in row]. This method works in a similar way to Pandas iloc[] but iat[] is used to return only single value and hence works faster than it.
Syntax: Dataframe.iat[column, row]
Parameters:
position: Position of element in column
label: Position of element in rowReturn type: Single element at passed position
To download the data set used in following example, click here.
In the following examples, the data frame used contains data of some NBA players. The image of data frame before any operations is attached below.

Example #1:
In this example, A dataframe is created by passing URL of csv to Pandas .read_csv() method. After that 3 is passed as column position and 7 as position in row and value at that position is returned using .iat[ ] method.
# importing pandas module import pandas as pd # reading csv file from url # creating column and row variables column = 3row = 7 # calling .iat[] method output = data.iat[column, row] # display print(output) # df display data.head() |
Output:
As shown in output image, the output can be compared and it can be seen that the Value of 3rd element in 7th column was returned.

Note:
- Unlike, .iloc[ ], This method only returns single value. Hence dataframe.at[3:6, 4:2] will return an error
- Since this method only works for single values, it is faster than .iloc[] method
Recommended Posts:
- Python | pandas.map()
- Python | Pandas dataframe.get()
- Python | Pandas PeriodIndex.day
- Python | Pandas DatetimeIndex.second
- Python | Pandas series.str.get()
- Python | Pandas dataframe.div()
- Python | Pandas Series.agg()
- Python | Pandas dataframe.mean()
- Python | Pandas dataframe.max()
- Python | Pandas dataframe.mad()
- Python | Pandas DatetimeIndex.day
- Python | Pandas dataframe.eq()
- Python | Pandas Period.second
- Python | Pandas.pivot()
- Python | Pandas.pivot_table()
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.



