Hey i am having input as list of JSON objects
[
{
‘sr_number’:687485784,
‘IC_Prediction’:’NPU-Soldier-Fractures’,
’ IC_Probability’:0.80,'Signatures':'PLATFORM-MLP-2'
},
{
'sr_number’:687485784,
‘IC_Prediction’:’Hotswap-Controller,
’IC_Probability’:0.63,
'Signatures' : 'PLATFORM-NLP-3'
}
},{},{},{} ]
I am looking to group them based on 'sr_number' and the desires output is as follows.
[ { ‘sr_number’ : 687485784,‘recommedations’:
[{‘IC_Prediction’:’NPU-Soldier-Fractures’,’IC_Probability’:0.80},
{‘IC_Prediction’:’Hotswap-Controller,’ IC_Probability’:0.63}
],
‘Signatures’: [ ‘PLATFORM-MLP-2’,’PLATFORM-NLP-3’]
},{},{}
]
I am new to python so don't know which data structure to use and how to get it done. Any help will be appreciated.