def fixations_chunks(fixations, startid, endid):
    """Chunk eyemovement data into scanpaths.

    :param: fixations: record array, nx4 fixation vector (onset, x, y, duration), output of preprocess()
    :param: startid, endid: array, start- and end-ids of the scanpaths, output from either create_chunks()
        or create_offsetchunks()

    :return: fixation_vector: array-like, a nx3 fixation vector (x, y, duration)
    """

    fixation_vector = []
    # slice fixation data according to indices, take columns start_x, start_y and
    # duration
    for idx in range(0, len(startid)):
        ind = fixations[startid[idx]:endid[idx]][["start_x",
                                                  "start_y",
                                                  "duration"]]
        fixation_vector.append(ind)
    return fixation_vector