def suffix(self, length):
    """Returns a `Trajectory` with the last `length` observations."""
    assert length >= 1
    t = Trajectory(self._last_observation)
    t._timesteps = self._timesteps[-(length - 1):]  # pylint: disable=protected-access
    return t
Returns a `Trajectory` with the last `length` observations.
trax/rl/task.py