title: How can I interpolate based on index values when using a pandas MultiIndex?
body: <p>I have demographic panel data, where each data point is categorized by a country, sex, year, and age. For a given country, sex, and year, my age-pattern has missing data, and I want to interpolate it based on the value of the age. For example, if 5 year-olds have a value of 5, and 10 year-olds have a value of 10, 6.3 year-olds should have a value of 6.3. I cannot use the default pandas 'linear' interpolation method because my age groups are not spaced linearly. My data look something like this:</p>
  
  <pre><code>iso3s = ['USA', 'CAN']
  age_start_in_years = [0, 0.01, 0.1, 1]
  years = [1990, 1991]
  sexes = [1,2]
  multi_index = pd.MultiIndex.from_product([iso3s,sexes,years,age_start_in_years],
                                            names = ['iso3','sex','year','age_start'])
  
  frame_length = len(iso3s)*len(age_start_in_years)*len(years)*len(sexes)
  test_df = pd.DataFrame({'value':range(frame_length)},index=multi_index)
  test_df=test_df.sortlevel()
  
  # Insert missingness to practice interpolating
  idx = pd.IndexSlice
  test_df.loc[idx[:,:,:,[0.01,0.1]],:] = np.NaN
  test_df
  
                                  value
  iso3    sex year    age_start   
  CAN     1   1990    0.00        0
                      0.01        NaN
                      0.10        NaN
                      1.00        3
              1991    0.00        4
                      0.01        NaN
                      0.10        NaN
                      1.00        7
         2    1990    0.00        8
  ...
  </code></pre>
  
  <p>However, when I try to use <code>test_df.interpolate(method='index')</code>, I get this error:</p>
  
  <pre><code>ValueError: Only `method=linear` interpolation is supported on MultiIndexes.
  </code></pre>
  
  <p>Surely there must be some way to interpolate based on the index values.</p>