dataGrid = pandas.DataFrame({(1): {(1): 1, (3): 2}, (2): {(1): 3, (3): 4}})

def getExtrapolatedInterpolatedValue(x, y):
    global dataGrid
if x not in dataGrid.index:
    dataGrid.ix[x] = nan
dataGrid = dataGrid.sort()
dataGrid = dataGrid.interpolate(method='index', axis=0).ffill(axis=0).bfill(
    axis=0)
if y not in dataGrid.columns.values:
    pass
Interpolation on DataFrame in pandas