Access a single value for a row/column label pair. If the index is not unique, all matching pairs are returned as an array. Similar to loc, in that both provide label-based lookups. Use at if you only need to get a single value in a DataFrame or Series.


Unlike pandas, pandas-on-Spark only allows using at to get values but not to set them.


Warning: If row_index matches a lot of rows, large amounts of data will be fetched, potentially causing your machine to run out of memory.


When label does not exist in DataFrame


>>> psdf = ps.DataFrame([[0, 2, 3], [0, 4, 1], [10, 20, 30]],
...                    index=[4, 5, 5], columns=['A', 'B', 'C'])
>>> psdf
    A   B   C
4   0   2   3
5   0   4   1
5  10  20  30

Get value at specified row/column pair

>>>[4, 'B']

Get array if an index occurs multiple times

>>>[5, 'B']
array([ 4, 20])