如何从多个字典获取字典列表并需要从基本计算开始日期和结束日期
[{'basic': 1000.0, 'end_date': '2011-01-31', 'start_date': '2011-01-01'},
{'basic': 1000.0, 'end_date': '2011-05-31', 'start_date': '2011-05-01'},
{'basic': 2000.0, 'end_date': '2012-01-31', 'start_date': '2012-01-01'},
{'basic': 2000.0, 'end_date': '2012-05-31', 'start_date': '2012-05-01'},
{'basic': 2500.0, 'end_date': '2012-07-31', 'start_date': '2012-07-01'},
{'basic': 2500.0, 'end_date': '2012-08-31', 'start_date': '2012-08-01'},
{'basic': 3500.0, 'end_date': '2013-01-31', 'start_date': '2013-01-01'},
{'basic': 3500.0, 'end_date': '2013-02-28', 'start_date': '2013-02-01'},
{'basic': 4000.0, 'end_date': '2013-11-30', 'start_date': '2013-11-01'}]
如果基本金额相等,我需要合并等量字典,start_date 是开始日期,end_date 是年终日期
举个例子
{'basic': 1000.0, 'end_date': '2011-01-31', 'start_date': '2011-01-01'},
{'basic': 1000.0, 'end_date': '2011-05-31', 'start_date': '2011-05-01'},
两个字典相等,所以我需要这样
[{'basic': 1000.0, 'start_date': '2011-01-01', 'end_date': '2011-12-31',},
{'basic': 2000.0, 'start_date': '2012-01-01', 'end_date': '2012-06-31', },
{'basic': 2500.0, 'start_date': '2012-07-01', 'end_date': '2012-12-31',},
{'basic': 3500.0, 'start_date': '2013-01-01', 'end_date': '2013-10-31'},
{'basic': 4000.0, 'start_date': '2013-11-01', 'end_date': '2013-12-30'}]