Good day , I have this problem in python, where i want to merge dictionary list of dictionary.. here is the thing i want to merge:
a = {
"0": {
"Holder": "23002154-1",
"HolderJob": "243340545",
"IsControl": "N",
"IsSPC": "N",
"LoadPosition": "5",
"MeasurementType": "XRF",
"PalletName": "12",
"PalletPosition": "1",
"ProcessToolName": "DLCX01",
"RecipeName": "APC_14A_COC_Al2O3_Fill-TEST",
"RunNumber": "4613"
},
"1": {
"Holder": "23002158-1",
"HolderJob": "243340544",
"IsControl": "N",
"IsSPC": "N",
"LoadPosition": "9",
"MeasurementType": "XRF",
"PalletName": "12",
"PalletPosition": "1",
"ProcessToolName": "DLCX01",
"RecipeName": "APC_14A_COC_Al2O3_Fill-TEST",
"RunNumber": "4613"
}
}
b = {
"0": {
"Claimable": "\"false\"",
"Experiment": "\"264644\"",
"HTNum": "\"516\"",
"HolderType": "\"CARJOB\"",
"MinorRev": "\"140688\"",
"Operation": "\"510150 DLCX DEPOSITION\"",
"ParentHolder": "\"23002158\"",
"ProductName": "\"AE_T_B\"",
"WaferEC": "\"140517\""
},
"1": {
"Claimable": "\"false\"",
"Experiment": "\"264644\"",
"HTNum": "\"516\"",
"HolderType": "\"CARJOB\"",
"MinorRev": "\"140688\"",
"Operation": "\"510150 DLCX DEPOSITION\"",
"ParentHolder": "\"23002158\"",
"ProductName": "\"AE_T_B\"",
"WaferEC": "\"140517\""
}
}
example output must be:
merge_a_b = {
"0": {
"Holder": "23002154-1",
"HolderJob": "243340545",
"IsControl": "N",
"IsSPC": "N",
"LoadPosition": "5",
"MeasurementType": "XRF",
"PalletName": "12",
"PalletPosition": "1",
"ProcessToolName": "DLCX01",
"RecipeName": "APC_14A_COC_Al2O3_Fill-TEST",
"RunNumber": "4613",
"Claimable": "\"false\"",
"Experiment": "\"264644\"",
"HTNum": "\"516\"",
"HolderType": "\"CARJOB\"",
"MinorRev": "\"140688\"",
"Operation": "\"510150 DLCX DEPOSITION\"",
"ParentHolder": "\"23002158\"",
"ProductName": "\"AE_T_B\"",
"WaferEC": "\"140517\""
},
"1": {
"Holder": "23002158-1",
"HolderJob": "243340544",
"IsControl": "N",
"IsSPC": "N",
"LoadPosition": "9",
"MeasurementType": "XRF",
"PalletName": "12",
"PalletPosition": "1",
"ProcessToolName": "DLCX01",
"RecipeName": "APC_14A_COC_Al2O3_Fill-TEST",
"RunNumber": "4613",
"Claimable": "\"false\"",
"Experiment": "\"264644\"",
"HTNum": "\"516\"",
"HolderType": "\"CARJOB\"",
"MinorRev": "\"140688\"",
"Operation": "\"510150 DLCX DEPOSITION\"",
"ParentHolder": "\"23002158\"",
"ProductName": "\"AE_T_B\"",
"WaferEC": "\"140517\""
}
}
so far i've used this code but it seems not to work:
def merge_dict(dict1,dict2):
dictio = dict(dict1,**dict2)
return dictio