Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DataFrame.to_html columns broken #890

Closed
lodagro opened this issue Mar 9, 2012 · 0 comments

Comments

@lodagro
Copy link
Contributor

commented Mar 9, 2012

Reported on mailing list, columns argument in DataFrame.to_html() broken.

In [31]: df
Out[31]:
   a         b         c   d
0  4 -0.548572 -0.333272 NaN
1  1 -0.502314  0.975798 NaN
2  9  0.283227  1.486831 NaN
3  3  1.514658 -0.747403 NaN
4  7 -1.415763 -0.697034 NaN

In [32]: print df.to_html(columns=['a'])
<table border="1">
  <thead>
    <tr>
      <th></th>
      <th>a</th>
      <th>b</th>
      <th>c</th>
      <th>d</th>
    </tr>
    </thead>
    <tbody>
    <tr>
      <td><strong>0</strong></td>
      <td> 4</td>
      <td>-0.548572</td>
      <td>-0.333272</td>
      <td>NaN</td>
    </tr>
    <tr>
      <td><strong>1</strong></td>
      <td> 1</td>
      <td>-0.502314</td>
      <td> 0.975798</td>
      <td>NaN</td>
    </tr>
    <tr>
      <td><strong>2</strong></td>
      <td> 9</td>
      <td> 0.283227</td>
      <td> 1.486831</td>
      <td>NaN</td>
    </tr>
    <tr>
      <td><strong>3</strong></td>
      <td> 3</td>
      <td> 1.514658</td>
      <td>-0.747403</td>
      <td>NaN</td>
    </tr>
    <tr>
      <td><strong>4</strong></td>
      <td> 7</td>
      <td>-1.415763</td>
      <td>-0.697034</td>
      <td>NaN</td>
    </tr>
  </tbody>
</table>

@wesm wesm closed this in edc90b3 Mar 11, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.