This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mans_agreements = {} # 假设 agreement 比较大 | |
for a in agreement: | |
mans_agreements.setdefault(a['agent_name'], []) | |
mans_agreements[a['agent_name']].append(a) | |
for man in agentman: | |
his_agreements = mans_agreements.get(man['agent_name'], []) | |
for a in his_agreements: | |
print(dict(man, **a)) |