title: Combining 2 pandas dataframes to 1 multi-dimensional one
body: <p>Dataframe 1 looks like this:</p>
  <pre><code>df1 = pd.DataFrame(
      {
          &quot;Farm ID&quot;: [&quot;1&quot;, &quot;2&quot;, &quot;2&quot;, &quot;3&quot;, &quot;3&quot;],
          &quot;Crop&quot;: [&quot;Type A&quot;, &quot;Type A&quot;, &quot;Type B&quot;, &quot;Type B&quot;, &quot;Type B&quot;],
          &quot;Area&quot;: [8, 4, 2, 3, 5],
          &quot;Diesel&quot;: [101, 215, 3, 0.6, 42],
      }
  )
  
  df1 = df1.set_index(['Farm ID', 'Crop'])
  df1
  </code></pre>
  <p>Dataframe 2 looks like this:</p>
  <pre><code>df2 = pd.DataFrame(
      {
          &quot;Name&quot;: [&quot;Area&quot;, &quot;Diesel&quot;],
          &quot;GHG&quot;: [690, 8.5],
          &quot;LU&quot;: [2.2, 0.3],
      }
  )
  
  df2 = df2.set_index('Name')
  df2
  </code></pre>
  <p>I now need to combine both such that I receive the following information:</p>
  <pre><code>                       GHG     LU
  Farm ID Crop    Name    
  1       Type A  Area   8*690    8*2.2
                  Diesel 101*690  101*2.2
  2       Type A  Area   4*690    4*2.2
                  Diesel 215*690  215*2.2 
          Type B  Area   ....
  </code></pre>
  <p>Any suggestions welcome as I am completely clueless. I also take ideas if there are better ways to structure this. I will have to do further analysis (e.g. aggregation by crop type or name, and similar) on the resulting dataframe and might think too complicated...
  Thanks a lot!</p>