title: Creating a nested dictionary from list of lists
body: <p>I am trying to convert below list of lists to a nested dictionary having  <code>&quot;epc_hlx&quot;</code> key values to be a <code>list of dictionary</code> because it can contain more than one dictionary element like this :</p>
  <pre><code>      &quot;epc_hlx&quot;:[
             {
                &quot;measure&quot;:{
                }
             },
             {
                &quot;measure&quot;:{
                }
             }
         ]
  </code></pre>
  <p><strong>List:</strong></p>
  <pre><code>lst =[['header', 'aircraft'],
  ['header', 'engine_1'],
  ['header', 'engine_2'],
  ['header', 'engine_1', 'epc_hlx'],
  ['header', 'engine_1', 'epc_hlx', 'measure'],
  ['header', 'engine_2', 'epc_hlx'],
  ['header', 'engine_2', 'epc_hlx', 'measure']]
  </code></pre>
  <p>Here is the <strong>Expected Output</strong> :</p>
  <pre><code>{
     &quot;header&quot;:{
         &quot;aircraft&quot;:{
         },
         &quot;engine1&quot;:{
            &quot;epc_hlx&quot;:[
                 {
                    &quot;measure&quot;:{
                    }
                 }
             ]
         },
         &quot;engine2&quot;:{
            &quot;epc_hlx&quot;:[
                 {
                    &quot;measure&quot;:{
                    }
                 }
             ]
         }
      }
  }
  </code></pre>
  <p>I have tried a few things but nothing works what I want it to be. So I am stuck on this one. Thanks in advance for your help</p>