pandas.Series.iat¶
Access a single value for a row/column pair by integer position.
Similar to iloc
, in that both provide integer-based lookups. Use
iat
if you only need to get or set a single value in a DataFrame
or Series.
- raises
- IndexError
When integer position is out of bounds
Examples¶
Get value at specified index position.¶
import numpy as np
import pandas as pd
from numba import njit
from numba import njit
@njit
def series_iat():
series = pd.Series([5, 4, 3, 2, 1], index=[0, 2, 4, 6, 8])
return series.iat[4] # Expect value: 1
print(series_iat())
$ python ./series/series_iat.py
1
See also
- DataFrame.at
Access a single value for a row/column label pair.
- DataFrame.loc
Purely label-location based indexer for selection by label.
- DataFrame.iloc
Access group of rows and columns by integer position(s).