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-ntot-1.Default value: 1
Return Value — num|list[num]|dict
- If
keyis a string andn==1or is not set, returns a number for the last recorded value of the named reporter. - If
keyis a string andn>1, returns a list with the lastnvalues of the named reporter. - If
keyis an integer, returns a dict with lists of the pastnvalues of all reporters.
Notes and Examples