Returns the latest recorded value or values from the model’s data.
Parameters
key — str, required
The column title whose data to retrieve. This will be the name registered using
data.addReporter()
.n — int, optional
Number of past values to retrieve. If
n=1
, the function will return a numerical value. Otherwise it returns a list with values from timet-n
tot-1
.Default value: 1
Return Value — num|list[num]|dict
- If
key
is a string andn==1
or is not set, returns a number for the last recorded value of the named reporter. - If
key
is a string andn>1
, returns a list with the lastn
values of the named reporter. - If
key
is an integer, returns a dict with lists of the pastn
values of all reporters.
Notes and Examples