from typing import OrderedDict


def init_vec(f, names, data):
    """Initialize resizable 1d arrays to hold the outputs."""

    # Iterate over 'names' and columns of 'data'
    dset = [
        (name, f.create_dataset(name, data=d, maxshape=(None,)))
        for name, d in zip(names, data.T)
    ]  # -> list
    return OrderedDict(dset)