def rec_keep_fields(rec, names):
    """
    Return a new numpy record array with only fields listed in names
    """

    if cbook.is_string_like(names):
        names = names.split(',')

    arrays = []
    for name in names:
        arrays.append(rec[name])

    return np.rec.fromarrays(arrays, names=names)