# Buggy code
def summary_params(
    results,
    yname=None,
    xname=None,
    alpha=0.05,
    use_t=True,
    skip_header=False,
    float_format="%.4f",
):
    """create a summary table of parameters from results instance

    Parameters
    ----------
    res : results instance
        some required information is directly taken from the result
        instance
    yname : string or None
        optional name for the endogenous variable, default is "y"
    xname : list of strings or None
        optional names for the exogenous variables, default is "var_xx"
    alpha : float
        significance level for the confidence intervals
    use_t : bool
        indicator whether the p-values are based on the Student-t
        distribution (if True) or on the normal distribution (if False)
    skip_headers : bool
        If false (default), then the header row is added. If true, then no
        header row is added.
    float_format : string
        float formatting options (e.g. ".3g")

    Returns
    -------
    params_table : SimpleTable instance
    """

    if isinstance(results, tuple):
        results, params, std_err, tvalues, pvalues, conf_int = results
    else:
        params = results.params
        bse = results.bse
        tvalues = results.tvalues
        pvalues = results.pvalues
        conf_int = results.conf_int(alpha)

    data = np.array([params, bse, tvalues, pvalues]).T
    data = np.hstack([data, conf_int])
    data = pd.DataFrame(data)

    if use_t:
        data.columns = [
            "Coef.",
            "Std.Err.",
            "t",
            "P>|t|",
            "[" + str(alpha / 2),
            str(1 - alpha / 2) + "]",
        ]
    else:
        data.columns = [
            "Coef.",
            "Std.Err.",
            "z",
            "P>|z|",
            "[" + str(alpha / 2),
            str(1 - alpha / 2) + "]",
        ]

    if not xname:
        data.index = results.model.exog_names
    else:
        data.index = xname

    return data


# Traceback (ValueError)
======================================================================
ERROR: statsmodels.discrete.tests.test_discrete.test_mnlogit_factor
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/travis/miniconda2/envs/statsmodels-test/lib/python2.7/site-packages/nose/case.py", line 197, in runTest
self.test(*self.arg)
File "/home/travis/miniconda2/envs/statsmodels-test/lib/python2.7/site-packages/statsmodels-0.8.0-py2.7-linux-x86_64.egg/statsmodels/discrete/tests/test_discrete.py", line 1436, in test_mnlogit_factor
summary2 = res.summary2()
File "/home/travis/miniconda2/envs/statsmodels-test/lib/python2.7/site-packages/statsmodels-0.8.0-py2.7-linux-x86_64.egg/statsmodels/discrete/discrete_model.py", line 3028, in summary2
confint[i])
File "/home/travis/miniconda2/envs/statsmodels-test/lib/python2.7/site-packages/statsmodels-0.8.0-py2.7-linux-x86_64.egg/statsmodels/iolib/summary2.py", line 339, in summary_params
data = np.hstack([data, conf_int])
File "/home/travis/miniconda2/envs/statsmodels-test/lib/python2.7/site-packages/numpy/core/shape_base.py", line 277, in hstack
return _nx.concatenate(arrs, 1)
ValueError: all the input array dimensions except for the concatenation axis must match exactly

# Fixed code
def summary_params(
    results,
    yname=None,
    xname=None,
    alpha=0.05,
    use_t=True,
    skip_header=False,
    float_format="%.4f",
):
    """create a summary table of parameters from results instance

    Parameters
    ----------
    res : results instance
        some required information is directly taken from the result
        instance
    yname : string or None
        optional name for the endogenous variable, default is "y"
    xname : list of strings or None
        optional names for the exogenous variables, default is "var_xx"
    alpha : float
        significance level for the confidence intervals
    use_t : bool
        indicator whether the p-values are based on the Student-t
        distribution (if True) or on the normal distribution (if False)
    skip_headers : bool
        If false (default), then the header row is added. If true, then no
        header row is added.
    float_format : string
        float formatting options (e.g. ".3g")

    Returns
    -------
    params_table : SimpleTable instance
    """

    if isinstance(results, tuple):
        results, params, bse, tvalues, pvalues, conf_int = results
    else:
        params = results.params
        bse = results.bse
        tvalues = results.tvalues
        pvalues = results.pvalues
        conf_int = results.conf_int(alpha)

    data = np.array([params, bse, tvalues, pvalues]).T
    data = np.hstack([data, conf_int])
    data = pd.DataFrame(data)

    if use_t:
        data.columns = [
            "Coef.",
            "Std.Err.",
            "t",
            "P>|t|",
            "[" + str(alpha / 2),
            str(1 - alpha / 2) + "]",
        ]
    else:
        data.columns = [
            "Coef.",
            "Std.Err.",
            "z",
            "P>|z|",
            "[" + str(alpha / 2),
            str(1 - alpha / 2) + "]",
        ]

    if not xname:
        data.index = results.model.exog_names
    else:
        data.index = xname

    return data