'Replace all rows with the values they map to in the
given dictionary. Any rows not present as keys in
the dictionary will have their nodes deleted.
Parameters
row_map : dict
Mapping of row numbers to new row numbers'

def replace_rows(self, row_map):

    for (key, data) in self.items():
        data[:] = [row_map[x] for x in data if (x in row_map)]
