Utils API Reference

Detailed Reference

quantopian.utils.last_n_events()

Extract the last n unique values keyed by some datetime key for each column.

Parameters:
  • count (int) -- The number of events to take.
  • datetimes (np.ndarray[datetime64[ns], ndim=2]) -- The event datetime.
  • values (np.ndarray[float64, ndim=2]) -- The event values.
Returns:

last_n_events -- An array with shape (count, values.shape[1]) containing the last count unique events keyed by datetimes for each column.

Return type:

np.ndarray[float64, ndim=2]