How can I use nearest neighbor interpolation only outside of bounds when using RegularGridInterpolator

  interpolation, python, scipy

Using RegularGridInterpolator for obtaining values outside of the hull (bounds) of the input data one can choose between extrapolation or fixed values. How can I get linear interpolation inside the hull and nearest neighbor interpolation outside of the hull?

Source: Python Questions