'Replace rows with the values in row_map.'

def replace_rows(self, row_map):

    if self.unique:
        del_keys = []
        for (key, data) in self.data.items():
            if (data in row_map):
                self.data[key] = row_map[data]
            else:
                del_keys.append(key)
        for key in del_keys:
            self.data.pop(key)
    else:
        for data in self.data.values():
            data[:] = [row_map[x] for x in data if (x in row_map)]
