list1 = [
{'eip': 60, 'day': '2014-7-5'},
{'etans': 96, 'day': '2014-7-5'},
{'etans': 30, 'day': '2014-4-6'},
{'eip': 100, 'day': '2014-4-6'},
] # 利用切片和zip函数,将list中的字典两辆组合成一个元组
list_temp = zip(list1[0::2], list1[1::2])
list_tuple = list(list_temp)
print(list_tuple) # 设置一个新的list容器list2,装新产生的复合日期相同,合并后的字典。
list2 = []
for tuple in list_tuple:
if tuple[0]['day'] == tuple[1]['day']:
dict_hebing = dict(tuple[0], **tuple[1])
# print(dict_hebing)
list2.append(dict_hebing)
print(list2)

  

仅作为参考,有弊端,慎用。

最新文章

  1. CAR
  2. 深入Java单例模式【转载】
  3. 【matlab】读写文件
  4. open/fopen read/fread write/fwrite区别
  5. 框架使用的技术主要是SpringMVC 在此基础上进行扩展
  6. hdu 5646 DZY Loves Partition 二分+数学分析+递推
  7. 自己封装的工具类,使用原生SwipeRefreshLayout+RecycleView实现下拉刷新和加载更多
  8. Delphi NativeXML 乱码的问题
  9. Raphael入门实例:动画与箭头
  10. 使用DTM ( Dynamic Topic Models )进行主题演化实验
  11. 关于SGA与memory_target 大小冲突照成数据库无法挂载问题
  12. Debug模式下程序卡
  13. 用SpringBoot搭建简单电商项目 01
  14. vuex 状态管理
  15. C#中d的??和?
  16. java去除html代码中含有的html、js、css标签,获取文字内容
  17. java中如何认定一个变量和方法
  18. Codeforces 797E - Array Queries
  19. Node学习笔记:建立TCP服务器和客户端之间的通信
  20. [穷尽]ADO.NET连接字符串

热门文章

  1. [Vim] 搜索模式(正则表达式)
  2. Failure to transfer org.springframework.boot:spring-boot-starter-parent:pom:2.0.1.RELEASE from https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempt
  3. jstorm开发指南-写个简单的jstorm应用
  4. 通过orderby关键字,LINQ可以实现升序和降序排序。LINQ还支持次要排序。
  5. Android NDK学习(4)使用cygwin生成.so库文件
  6. mac下升级terminal/终端的subversion版本方法
  7. LeetCode 11 Container With Most Water(分支​判断问题)
  8. jenkins与SonarQube集成
  9. POJ 2456 Aggressive cows(二分答案)
  10. hihoCoder挑战赛28 题目2 : 二进制翻转