Skip to content

REGR: <th> tags for notebook display closes #28204 #28216

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

Merged
merged 3 commits into from
Aug 30, 2019

Conversation

simonjayhawkins
Copy link
Member

@simonjayhawkins simonjayhawkins added Regression Functionality that used to work in a prior pandas version IO HTML read_html, to_html, Styler.apply, Styler.applymap labels Aug 29, 2019
@simonjayhawkins
Copy link
Member Author

not added whatsnew. target 0.25.2?

@TomAugspurger
Copy link
Contributor

Was it a regression in 0.25 or earlier?

@simonjayhawkins
Copy link
Member Author

haven't checked thoroughly but i think the bug was introduced in 0.25.1 #27991

@TomAugspurger
Copy link
Contributor

With 0.25.0

In [2]: df = pd.DataFrame({"a": 1}, index=pd.MultiIndex.from_product([['a'], [2, 3]]))

In [3]: print(df._repr_html_())
<div>
<style scoped>
    .dataframe tbody tr th:only-of-type {
        vertical-align: middle;
    }

    .dataframe tbody tr th {
        vertical-align: top;
    }

    .dataframe thead th {
        text-align: right;
    }
</style>
<table border="1" class="dataframe">
  <thead>
    <tr style="text-align: right;">
      <th></th>
      <th></th>
      <th>a</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <th rowspan="2" valign="top">a</th>
      <th>2</th>
      <td>1</td>
    </tr>
    <tr>
      <th>3</th>
      <td>1</td>
    </tr>
  </tbody>
</table>
</div>

and with 0.25.1

In [3]: print(df._repr_html_())
<div>
<style scoped>
    .dataframe tbody tr th:only-of-type {
        vertical-align: middle;
    }

    .dataframe tbody tr th {
        vertical-align: top;
    }

    .dataframe thead th {
        text-align: right;
    }
</style>
<table border="1" class="dataframe">
  <thead>
    <tr style="text-align: right;">
      <th></th>
      <th></th>
      <th>a</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td rowspan="2" valign="top">a</td>
      <td>2</td>
      <td>1</td>
    </tr>
    <tr>
      <td>3</td>
      <td>1</td>
    </tr>
  </tbody>
</table>
</div>

So it seems to have been a 0.25.1 regression (so target for 0.25.2)

@simonjayhawkins
Copy link
Member Author

thanks @TomAugspurger . will do.

@simonjayhawkins simonjayhawkins added this to the 0.25.2 milestone Aug 29, 2019
Copy link
Contributor

@TomAugspurger TomAugspurger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Merge conflict in the release notes.

@TomAugspurger TomAugspurger merged commit fadb271 into pandas-dev:master Aug 30, 2019
meeseeksmachine pushed a commit to meeseeksmachine/pandas that referenced this pull request Aug 30, 2019
@simonjayhawkins simonjayhawkins deleted the th-tags branch August 30, 2019 23:40
MarcoGorelli pushed a commit to MarcoGorelli/pandas that referenced this pull request Sep 3, 2019
proost pushed a commit to proost/pandas that referenced this pull request Dec 19, 2019
proost pushed a commit to proost/pandas that referenced this pull request Dec 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
IO HTML read_html, to_html, Styler.apply, Styler.applymap Regression Functionality that used to work in a prior pandas version
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CSS selector for index cells
2 participants