def print_xarray(xarr, field, fill=True):
    """
    Print the field of every key in input xarray

    Parameters
    ----------
    xarr : xarray.Dataset
        contains some number of xarray datasets
    field : string
        field to print
    """
    try:
        df = xarr.to_dataframe()
    except IndexError:
        print('No valid PVs to print!')
        return
    df = df.T[field].T
    if fill:
        df = df.fillna(method='pad')
        while any(df.iloc[0].isnull()):
            df = df.iloc[1:]
        print(df.to_string())
    else:
        shortest = None
        for pv in list(df.keys()):
            nchar = len(pv)
            if shortest is None or nchar < shortest:
                shortest = nchar
        print(df.fillna('-' * shortest).to_string())
