import csv


def create_column_dicts(path_to_input):
    """Creates dictionaries: {column_index, column_name} and
    {column_name, column_index}"""
    cols = {}
    with open(path_to_input, newline="") as csvfile:
        inputreader = csv.reader(csvfile, delimiter=",")
        row = next(inputreader)
        for i, col in enumerate(row):
            cols[i] = col
    # reverse dictionary: {column_name, column_index}
    cols_inds = {v: k for k, v in cols.items()}
    return cols, cols_inds