name_map = {'oldcol1': 'newcol1', 'oldcol2': 'newcol2', 'oldcol3': 'newcol3'...}for row in rows: # Each row is a dict of the form: {'oldcol1': '...', 'oldcol2': '...'} row = dict((name_map[name], val) for name, val in row.iteritems()) ...或在具有Dict理解力的Python2.7 +中:
for row in rows: row = {name_map[name]: val for name, val in row.items()}


