这可能是Python中的一个经典问题,但我还没有找到答案。
我有一个字典列表,这些字典具有相似的键。它看起来像这样:
[{0: myech.MatchingResponse at 0x10d6f7fd0,
3: myech.MatchingResponse at 0x10d9886d0,
6: myech.MatchingResponse at 0x10d6f7d90,
9: myech.MatchingResponse at 0x10d988ad0},
{0: myech.MatchingResponse at 0x10d6f7b10,
3: myech.MatchingResponse at 0x10d6f7f90>}]
我想要一个新字典,其中[0,3,6,9]作为键,"myech.MatchingResponse"列表作为值。
当然,我可以使用简单的循环来实现这一点,但我想知道是否有更高效的解决方案。