def period2pos(index, date):
    """Returns the position (index) of a timestamp vector.

    Args:
        index (list): timestamp vector.
        date (string): date to search.

    Returns:
        position (int): position of date in index.

    """
    x = [i for i, elem in enumerate(index) if elem == date]
    if x == []:
        raise ValueError('Date does not exists: ' + date.__repr__())
    return x[0]