def _row_dict(row, names, prefix):
    """Extract the relevant names/values from a DataFrame row and convert them
    to a dictionary without the prefixes."""

    L = len(prefix)
    r = row.to_dict()
    d = {}
    for name in names:
        d[name[L:]] = r[name]

    return d