'Seek to an observation indexed k in the file and return it, ordered
by Stata\'s output to the .dta file.
k is zero-indexed.  Prefer using R.data() for performance.'

def __getitem__(self, k):

    if ((not isinstance(k, (int, long))) or (k < 0) or (k > (len(self) - 1))):
        raise IndexError(k)
    loc = (self._data_location + (sum(self._col_size()) * k))
    if (self._file.tell() != loc):
        self._file.seek(loc)
    return self._next()
