Hi team,
I have two list of dictionary, we need below output format. kindly help us.
Pop default should be "domain" and "type
I have two list of dictionary, we need below output format. kindly help us.
list1 = [{'type': 'cumulative', 'domain': 'NEED', 'success': 26, 'failure': 7}] list2 = [{'type': 'environment', 'environment': 'ACP', 'domain': 'NEED', 'total_hits': 11, 'success': 11, 'failure': 0}, {'type': 'environment', 'environment': 'DIT', 'domain': 'NEED', 'total_hits': 11, 'success': 4, 'failure': 7}, {'type': 'environment', 'environment': 'INT', 'domain': 'NEED', 'total_hits': 11, 'success': 11, 'failure': 0}, {'type': 'environment', 'environment': 'ACP', 'domain': 'FEED', 'total_hits': 11, 'success': 11, 'failure': 0}, {'type': 'environment', 'environment': 'DIT', 'domain': 'FEED', 'total_hits': 11, 'success': 4, 'failure': 7}, {'type': 'environment', 'environment': 'INT', 'domain': 'FEED', 'total_hits': 11, 'success': 11, 'failure': 0}]O/P Required :
Pop default should be "domain" and "type
Output:{
NEED: {
cumulative :[{ 'success': 26,
'failure': 7
}],
environment : [
ACP : {'total_hits': 11,
'success': 11,
'failure': 0
},
DIT : {'total_hits': 11,
'success': 4,
'failure': 7
},
INT : {'total_hits': 11,
'success': 11,
'failure': 0
}
]
},
FEED: {
environment : [
ACP : {'total_hits': 11,
'success': 11,
'failure': 0
},
DIT : {'total_hits': 11,
'success': 4,
'failure': 7
},
INT : {'total_hits': 11,
'success': 11,
'failure': 0
}
]
}
}