pandas.DataFrame.at — pandas 0.25.3 documentation (original) (raw)
DataFrame.
at
¶
Access a single value for a row/column label pair.
Similar to loc
, in that both provide label-based lookups. Useat
if you only need to get or set a single value in a DataFrame or Series.
Raises: | KeyError When label does not exist in DataFrame |
---|
See also
Access a single value for a row/column pair by integer position.
Access a group of rows and columns by label(s).
Access a single value using a label.
Examples
df = pd.DataFrame([[0, 2, 3], [0, 4, 1], [10, 20, 30]], ... index=[4, 5, 6], columns=['A', 'B', 'C']) df A B C 4 0 2 3 5 0 4 1 6 10 20 30
Get value at specified row/column pair
Set value at specified row/column pair
df.at[4, 'B'] = 10 df.at[4, 'B'] 10
Get value within a Series