来源《利用python进行数据分析》P65 update方法合并字典 可以使用update方法将两个字典合并 d1={'a': 'some value', '7': 'an integer'} d1.update({'b': 'foo', 'c': 12}) #d1={'a': 'some value', '7': 'an integer', 'b': 'foo', 'c': 12} 注意:对于任何原字典中已经存在的键,如果传给update方法的数据也含有相同的键,则它的值会被覆盖