there is list of dictionaries:
[
{
"id" : 2.0,
"code" : "12345"
},
{
"id" : 2.0,
"code" : "23456"
},
{
"id" : 4.0,
"code" : "6767"
},
{
"id" : 5.0,
"code" : "567"
},
{
"id" : 4.0,
"code" : "55657"
}
]
I want to merge dict that have common id, then i want to have this list as you see:
[
{
"id" : 2.0,
"code" : "12345,23456"
},
{
"id" : 4.0,
"code" : "6767,55657"
},
{
"id" : 5.0,
"code" : "567"
}
]
is there any faster way can check all of this in for loop ?