# Buggy code
def summary2(self, alpha=0.05, float_format="%.4f"):
    """Experimental function to summarize regression results

    Parameters
    -----------
    alpha : float
        significance level for the confidence intervals
    float_format: string
        print format for floats in parameters summary

    Returns
    -------
    smry : Summary instance
        this holds the summary tables and text, which can be printed or
        converted to various output formats.

    See Also
    --------
    statsmodels.iolib.summary2.Summary : class to hold summary
        results

    """

    from statsmodels.iolib import summary2

    smry = summary2.Summary()
    smry.add_dict(summary2.summary_model(self))
    # One data frame per value of endog
    eqn = self.params.shape[1]
    confint = self.conf_int(alpha)
    for i in range(eqn):
        coefs = summary2.summary_params(
            self,
            alpha,
            self.params[:, i],
            self.bse[:, i],
            self.tvalues[:, i],
            self.pvalues[:, i],
            confint[i],
        )
        # Header must show value of endog
        level_str = self.model.endog_names + " = " + str(i)
        coefs[level_str] = coefs.index
        coefs = coefs.iloc[:, [-1, 0, 1, 2, 3, 4, 5]]
        smry.add_df(coefs, index=False, header=True, float_format=float_format)
        smry.add_title(results=self)
    return smry


# 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 summary2(self, alpha=0.05, float_format="%.4f"):
    """Experimental function to summarize regression results

    Parameters
    -----------
    alpha : float
        significance level for the confidence intervals
    float_format: string
        print format for floats in parameters summary

    Returns
    -------
    smry : Summary instance
        this holds the summary tables and text, which can be printed or
        converted to various output formats.

    See Also
    --------
    statsmodels.iolib.summary2.Summary : class to hold summary
        results

    """

    from statsmodels.iolib import summary2

    smry = summary2.Summary()
    smry.add_dict(summary2.summary_model(self))
    # One data frame per value of endog
    eqn = self.params.shape[1]
    confint = self.conf_int(alpha)
    for i in range(eqn):
        coefs = summary2.summary_params(
            (
                self,
                self.params[:, i],
                self.bse[:, i],
                self.tvalues[:, i],
                self.pvalues[:, i],
                confint[i],
            ),
            alpha=alpha,
        )
        # Header must show value of endog
        level_str = self.model.endog_names + " = " + str(i)
        coefs[level_str] = coefs.index
        coefs = coefs.iloc[:, [-1, 0, 1, 2, 3, 4, 5]]
        smry.add_df(coefs, index=False, header=True, float_format=float_format)
        smry.add_title(results=self)
    return smry