Repository: statsmodels/statsmodels

Issue:
Fix the roots table of ARMA
The roots table wasn't formatted correctly on Jupyter Notebook. I fixed it according to the way that https://github.com/statsmodels/statsmodels/blob/master/statsmodels/iolib/summary.py#L473 uses.

**Before**

![before_html](https://user-images.githubusercontent.com/594141/38404093-361bf00a-399a-11e8-8774-ab4a45821909.png)
![before_txt](https://user-images.githubusercontent.com/594141/38404092-35f35c9e-399a-11e8-9347-504b265fe840.png)


**After**

![after_html](https://user-images.githubusercontent.com/594141/38404098-3d063eb6-399a-11e8-8c5e-0a63b85fe1f1.png)
![after_txt](https://user-images.githubusercontent.com/594141/38404097-3cdf3848-399a-11e8-8fd5-215d8fa337cf.png)


Discussion:

Resolving patch:
diff --git a/statsmodels/tsa/arima_model.py b/statsmodels/tsa/arima_model.py
--- a/statsmodels/tsa/arima_model.py
+++ b/statsmodels/tsa/arima_model.py
@@ -1660,15 +1660,16 @@ def summary(self, alpha=.05):
         if len(stubs):  # not 0, 0
             modulus = np.abs(roots)
             data = np.column_stack((roots.real, roots.imag, modulus, freq))
-            roots_table = SimpleTable(data,
-                                      headers=['           Real',
+            roots_table = SimpleTable([('%17.4f' % row[0],
+                                        '%+17.4fj' % row[1],
+                                        '%17.4f' % row[2],
+                                        '%17.4f' % row[3]) for row in data],
+                                      headers=['            Real',
                                                '         Imaginary',
                                                '         Modulus',
                                                '        Frequency'],
                                       title="Roots",
-                                      stubs=stubs,
-                                      data_fmts=["%17.4f", "%+17.4fj",
-                                                 "%17.4f", "%17.4f"])
+                                      stubs=stubs)
 
             smry.tables.append(roots_table)
         return smry


Test patch:
diff --git a/statsmodels/tsa/tests/test_arima.py b/statsmodels/tsa/tests/test_arima.py
--- a/statsmodels/tsa/tests/test_arima.py
+++ b/statsmodels/tsa/tests/test_arima.py
@@ -300,6 +300,32 @@ def setup_class(cls):
         cls.res1 = ARMA(endog, order=(2,2)).fit(trend="c", disp=-1)
         cls.res2 = results_arma.Y_arma22c()
 
+    def test_summary(self):
+        # regression test for html of roots table #4434
+        # we ignore whitespace in the assert
+        summ = self.res1.summary()
+        summ_roots = """\
+        <tableclass="simpletable">
+        <caption>Roots</caption>
+        <tr>
+        <td></td><th>Real</th><th>Imaginary</th><th>Modulus</th><th>Frequency</th>
+        </tr>
+        <tr>
+        <th>AR.1</th><td>1.0991</td><td>-1.2571j</td><td>1.6698</td><td>-0.1357</td>
+        </tr>
+        <tr>
+        <th>AR.2</th><td>1.0991</td><td>+1.2571j</td><td>1.6698</td><td>0.1357</td>
+        </tr>
+        <tr>
+        <th>MA.1</th><td>-1.1702</td><td>+0.0000j</td><td>1.1702</td><td>0.5000</td>
+        </tr>
+        <tr>
+        <th>MA.2</th><td>1.2215</td><td>+0.0000j</td><td>1.2215</td><td>0.0000</td>
+        </tr>
+        </table>"""
+        assert_equal(summ.tables[2]._repr_html_().replace(' ', ''),
+                     summ_roots.replace(' ', ''))
+
 
 class Test_Y_ARMA50_Const(CheckArmaResultsMixin, CheckForecastMixin):
     @classmethod