I have two lists in Python something similar.
list1 = [
{"name": "sample1",
"place": "sampleplace1",
"value": "",
"time": "sampletime"
},
{"name": "sample2",
"place": "sampleplace2",
"value": "",
"time": "sampletime2"
}
]
list2 = [
{"name": "sample1",
"value": "10"
},
{"name": "sample2",
"value": "20"
}
]
I need to compare both the lists and whereever the name is matching, I need to update the value property in list1. I did by running a for loop on list1, get the matching list object from list2 for each list1 object and update the value.
I'm just wondering, is there a way to do this without running a for loop (something like Linq in C#)?