title: Merge dictionaries in a list based on common key in Python
body: <p>This is my list of dictionaries object:</p>
  <pre class="lang-json prettyprint-override"><code>[
     {
        &quot;id&quot;: &quot;123&quot;,
        &quot;name&quot;: &quot;abc&quot;,
        &quot;property&quot;: {
           &quot;path&quot;: &quot;path1&quot;,
           &quot;d&quot;: &quot;xyz&quot;
        }
     },
     {
        &quot;id&quot;: &quot;123&quot;,
        &quot;name&quot;: &quot;abc&quot;,
        &quot;property1&quot;: {
           &quot;path&quot;: &quot;path2&quot;,
           &quot;f&quot;: &quot;abc&quot;
        }
     },
     {
        &quot;id&quot;: &quot;123&quot;,
        &quot;name&quot;: &quot;abc&quot;,
        &quot;property&quot;: {
           &quot;path&quot;: &quot;path3&quot;,
           &quot;d&quot;: &quot;def&quot;
        }
     },
     {
        &quot;id&quot;: &quot;123&quot;,
        &quot;name&quot;: &quot;abc&quot;,
        &quot;property1&quot;: {
           &quot;path&quot;: &quot;path4&quot;,
           &quot;f&quot;: &quot;lmn&quot;
        }
     },
     {
        &quot;id&quot;: &quot;123&quot;,
        &quot;name&quot;: &quot;abc&quot;,
        &quot;property2&quot;: {
           &quot;path&quot;: &quot;path5&quot;,
           &quot;g&quot;: &quot;opt&quot;
        }
     }
  ]
  </code></pre>
  <p>Expected output:</p>
  <pre class="lang-json prettyprint-override"><code>[
     {
        &quot;id&quot;: &quot;123&quot;,
        &quot;name&quot;: &quot;abc&quot;,
        &quot;data1&quot;: {
           &quot;property&quot;: [
              {
                 &quot;path&quot;: &quot;path1&quot;,
                 &quot;d&quot;: &quot;xyz&quot;
              },
              {
                 &quot;path&quot;: &quot;path3&quot;,
                 &quot;d&quot;: &quot;def&quot;
              }
           ]
        }
     },
     {
        &quot;data2&quot;: {
           &quot;property1&quot;: [
              {
                 &quot;path&quot;: &quot;path2&quot;,
                 &quot;f&quot;: &quot;abc&quot;
              },
              {
                 &quot;path&quot;: &quot;path4&quot;,
                 &quot;f&quot;: &quot;lmn&quot;
              }
           ]
        }
     },
     {
        &quot;data3&quot;: {
           &quot;property2&quot;: [
              {
                 &quot;path&quot;: &quot;path5&quot;,
                 &quot;g&quot;: &quot;opt&quot;
              }
           ]
        }
     }
  ]
  </code></pre>
  <p>How do I merge the dictionaries based on 'id' and 'name' key and combine the property, property1, property3 fields from all the dictionaries in Python, The number of dictionary objects in the list is not fixed, it might vary, but the format of the output is fixed and keys are fixed (id, name, property, property1, property2). Please assist</p>