# Buggy code
def crit(self, prob, n):
    """returns interpolated quantiles, similar to ppf or isf

    use two sequential 1d interpolation, first by n then by prob

    Parameters
    ----------
    prob : array_like
        probabilities corresponding to the definition of table columns
    n : int or float
        sample size, second parameter of the table

    Returns
    -------
    ppf : array_like
        critical values with same shape as prob

    """
    prob = np.asarray(prob)
    alpha = self.alpha
    critv = self._critvals(n)

    # vectorized
    cond_ilow = prob > alpha[0]
    cond_ihigh = prob < alpha[-1]
    cond_interior = np.logical_or(cond_ilow, cond_ihigh)

    # scalar
    if prob.size == 1:
        if cond_interior:
            return interp1d(alpha, critv)(prob)
        else:
            return np.nan

    # vectorized
    quantile = np.nan * np.ones(prob.shape)  # nans for outside
    quantile[cond_interior] = interp1d(alpha, critv)(prob[cond_interior])
    return quantile


# Traceback (ValueError)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/testone/lib64/python3.6/site-packages/statsmodels/stats/_lilliefors.py", line 344, in kstest_fit
pval = lilliefors_table.prob(d_ks, nobs)
File "/home/testone/lib64/python3.6/site-packages/statsmodels/stats/tabledist.py", line 120, in prob
critv = self._critvals(n)
File "/home/testone/lib64/python3.6/site-packages/statsmodels/stats/tabledist.py", line 99, in _critvals
return np.array([p(n) for p in self.polyn])
File "/home/testone/lib64/python3.6/site-packages/statsmodels/stats/tabledist.py", line 99, in <listcomp>
return np.array([p(n) for p in self.polyn])
File "/usr/lib64/python3.6/site-packages/scipy/interpolate/polyint.py", line 79, in __call__
y = self._evaluate(x)
File "/usr/lib64/python3.6/site-packages/scipy/interpolate/interpolate.py", line 634, in _evaluate
below_bounds, above_bounds = self._check_bounds(x_new)
File "/usr/lib64/python3.6/site-packages/scipy/interpolate/interpolate.py", line 663, in _check_bounds
raise ValueError("A value in x_new is below the interpolation "
ValueError: A value in x_new is below the interpolation range.

# Fixed code
def crit(self, prob, n):
    """
    Returns interpolated quantiles, similar to ppf or isf

    use two sequential 1d interpolation, first by n then by prob

    Parameters
    ----------
    prob : array_like
        probabilities corresponding to the definition of table columns
    n : int or float
        sample size, second parameter of the table

    Returns
    -------
    ppf : array_like
        critical values with same shape as prob
    """
    prob = np.asarray(prob)
    alpha = self.alpha
    critv = self._critvals(n)

    # vectorized
    cond_ilow = prob > alpha[0]
    cond_ihigh = prob < alpha[-1]
    cond_interior = np.logical_or(cond_ilow, cond_ihigh)

    # scalar
    if prob.size == 1:
        if cond_interior:
            return interp1d(alpha, critv)(prob)
        else:
            return np.nan

    # vectorized
    quantile = np.nan * np.ones(prob.shape)  # nans for outside
    quantile[cond_interior] = interp1d(alpha, critv)(prob[cond_interior])
    return quantile