def value_index_map(array):
    """
    Given input array, returns dict with key/values k,i,
    where i is the 0-index where value k appeared in the input array
    Assumes array elements are unique
    Used to get a mapping from pk's of an query set axis to the 0-index
    :param array:
    :return: dict
    """
    output_map = {v: i for i, v in enumerate(array)}
    return output_map