title: Merging two multiindexes together in Pandas
body: <p>I have two multiindexes which I want to merge together on the indexes. 
  Below I want to merge on <code>Cif</code> and <code>ye</code> and have both 0 columns in the <code>al_staff</code> dataframe. </p>
  
  <pre><code>al_staff=pd.merge(new.reset_index(), staff_cost_sum.reset_index(), on=['Cif', 'ye'], how='inner').set_index(['Cif','ye'])
  </code></pre>
  
  <p>I reset the index and specified what columns to merge on, and defined what columns should be in the new index. Nothing is returned. </p>
  
  <p>The 'new' dataframe is a combination of several dataframes similar to <code>staff_sum</code>, but they have the same index, <code>Cif</code> and <code>ye</code>, per the below:</p>
  
  <pre><code>new=pd.concat([staff_cost_sum, sub_cost_sum, consum_cost_sum, soft_cost_sum]).sum(level=['Cif','ye'])
  new.reset_index(inplace=True)
  </code></pre>
  
  <p>It seems that the data types are being changed in the process, as the new dataframe has <code>Cif</code> and <code>ye</code> set as object types and <code>staff_cost_sum</code> remains as <code>int64</code> data types.</p>
  
  <p>How can I retain the same data type of the <code>Cif</code> and <code>ye</code> column in the 'new' dataframe? It doesn't matter to me what data types they are, as this is all I need to do (so there are no future ramifications), but I'd rather know how to edit the code examples below to do this rather than do a workaround solution. Any thoughts appreciate though.</p>
  
  <p>The two multiindex data sets are below.</p>
  
  <pre><code>Cif     ye  0
  277     13  519297.676200
          14  770372.973000
          15  63046.854000
  312     13  21292.546058
  322     14  60154.098500
  361     13  78735.072000
  
  Cif     ye  0
  277     13  444597.411500
          14  484438.682500
  312     13  21292.546058
  322     14  60154.098500
  361     13  78735.072000
          16  35333.400000
  
  
  
  
  new.reset_index().info()
  
  &lt;class 'pandas.core.frame.DataFrame'&gt;
  RangeIndex: 2101 entries, 0 to 2100
  Data columns (total 3 columns):
  Cif    2101 non-null object
  ye     2101 non-null object
  0      2101 non-null float64
  dtypes: float64(1), object(2)
  memory usage: 49.3+ KB
  
  
  staff_cost_sum.reset_index().info()
  
  &lt;class 'pandas.core.frame.DataFrame'&gt;
  RangeIndex: 1899 entries, 0 to 1898
  Data columns (total 3 columns):
  Cif    1899 non-null int64
  ye     1899 non-null int64
  0      1899 non-null float64
  dtypes: float64(1), int64(2)
  memory usage: 44.6 KB
  </code></pre>
  
  <p>Intended output: </p>
  
  <pre><code>                  0_x            0_y
  Cif ye                              
  277 13  444597.411500  519297.676200
      14  484438.682500  770372.973000
  312 13   21292.546058   21292.546058
  322 14   60154.098500   60154.098500
  361 13   78735.072000   78735.072000
  </code></pre>