For list of dicts: merge same key values, sum another diff. values, count each merge iteration +1 Python
If anybody can help me with some task? I have list of dicts(or tuples), where: if tuples: comment_id, user_id, comment_date, comment_time, comment_likes (‘51799’, ‘112801710’, ‘2015-12-07′, ’00:03:21’, ‘0’), (‘51761’, ‘112801710’, ‘2015-12-06′, ’19:31:46’, ‘3’), (‘51764’, ‘112801710’, ‘2015-12-06′, ’19:54:19’, ‘0’), (‘51741’, ‘112801710’, ‘2015-12-06′, ’14:17:34’, ‘2’), (‘51768’, ‘52879933’, ‘2015-12-06′, ’20:03:34’, ‘0’), (‘51766’, ‘52879933’, ‘2015-12-06′, ’21:33:34’, ‘0’), or can be converted to dict like: {‘comm_count’: 1, ‘user_id’: ‘217407103’, ‘likes’: 0}, comment_id – is always unique and cannot meet twice in this list, user_id – is not unique for this list, it can be there as much times as comments were left in the set of posts (naturally I wanted to use this as counter) comment_date and comment_time – can be ignored, needed to sel fromShort Read more…