def quantile(obj, quantile, window, min_periods=None, interpolation='linear'):
    """
    Find the value which corresponds to a given quantile, based on a rolling window
    """
    return obj.rolling(window=window, min_periods=min_periods).quantile(quantile, interpolation=interpolation)