# Buggy code
def prob(self, x, n):
    """find pvalues by interpolation, eiter cdf(x) or sf(x)

    returns extrem probabilities, 0.001 and 0.2, for out of range

    Parameters
    ----------
    x : array_like
        observed value, assumed to follow the distribution in the table
    n : float
        sample size, second parameter of the table

    Returns
    -------
    prob : arraylike
        This is the probability for each value of x, the p-value in
        underlying distribution is for a statistical test.

    """
    critv = self._critvals(n)
    alpha = self.alpha
    #        if self.signcrit == 1:
    #            if x < critv[0]:  #generalize: ? np.sign(x - critvals[0]) == self.signcrit:
    #                return alpha[0]
    #            elif x > critv[-1]:
    #                return alpha[-1]
    #        elif self.signcrit == -1:
    #            if x > critv[0]:
    #                return alpha[0]
    #            elif x < critv[-1]:
    #                return alpha[-1]

    if self.signcrit < 1:
        # reverse if critv is decreasing
        critv, alpha = critv[::-1], alpha[::-1]

    # now critv is increasing
    if np.size(x) == 1:
        if x < critv[0]:
            return alpha[0]
        elif x > critv[-1]:
            return alpha[-1]
        return interp1d(critv, alpha)(x)[()]
    else:
        # vectorized
        cond_low = x < critv[0]
        cond_high = x > critv[-1]
        cond_interior = ~np.logical_or(cond_low, cond_high)

        probs = np.nan * np.ones(x.shape)  # mistake if nan left
        probs[cond_low] = alpha[0]
        probs[cond_low] = alpha[-1]
        probs[cond_interior] = interp1d(critv, alpha)(x[cond_interior])

        return probs


# 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 prob(self, x, n):
    """
    Find pvalues by interpolation, either cdf(x)

    Returns extreme probabilities, 0.001 and 0.2, for out of range

    Parameters
    ----------
    x : array_like
        observed value, assumed to follow the distribution in the table
    n : float
        sample size, second parameter of the table

    Returns
    -------
    prob : array_like
        This is the probability for each value of x, the p-value in
        underlying distribution is for a statistical test.
    """
    critv = self._critvals(n)
    alpha = self.alpha

    if self.signcrit < 1:
        # reverse if critv is decreasing
        critv, alpha = critv[::-1], alpha[::-1]

    # now critv is increasing
    if np.size(x) == 1:
        if x < critv[0]:
            return alpha[0]
        elif x > critv[-1]:
            return alpha[-1]
        return interp1d(critv, alpha)(x)[()]
    else:
        # vectorized
        cond_low = x < critv[0]
        cond_high = x > critv[-1]
        cond_interior = ~np.logical_or(cond_low, cond_high)

        probs = np.nan * np.ones(x.shape)  # mistake if nan left
        probs[cond_low] = alpha[0]
        probs[cond_low] = alpha[-1]
        probs[cond_interior] = interp1d(critv, alpha)(x[cond_interior])

        return probs