8000 ENH: DataFrame.style sparsified MultiIndex by TomAugspurger · Pull Request #13775 · pandas-dev/pandas · GitHub
[go: up one dir, main page]

Skip to content

Conversation

@TomAugspurger
Copy link
Contributor

Notebook comparing DataFrame._html_repr_ to DataFrame.style

I think we're identical for non-truncated DataFrames. That' has not been implemented in Styler yet.

Along the way I noticed two other things that ended up needing fixing.

  1. DataFrame.columns.names were not displayed
  2. CSS classes weren't being assigned correctly to row labels.

The fixes ended up being pretty intertwined, so I've put them in a single PR. Unfortunately, the commits are a bit jumbled as well :/

@TomAugspurger TomAugspurger added the Output-Formatting __repr__ of pandas objects, to_string label Jul 24, 2016
@TomAugspurger TomAugspurger added this to the 0.19.0 milestone Jul 24, 2016
Copy link
Contributor

Choose a reason for hiding this comment

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

use the pr number

@TomAugspurger
Copy link
Contributor Author

maybe put a ref to the style docs (e.g. not sure how much of an example is needed here)

@jreback this was undocumented... Adding this section to the notebook. Will push soon.

CSS Classes

Certain CSS classes are attached to cells.

  • Index and Column names include index_name and level<k> where k is its level in a MultiIndex
  • Index label cells include
    • row_heading
    • row<n> where n is the numeric position of the row
    • level<k> where k is the level in a MultiIndex
  • Column label cells include
    • col_heading
    • col<n> where n is the numeric position of the column
    • level<k> where k is the level in a MultiIndex
  • Blank cells include blank
  • Data cells include data

@codecov-io
Copy link
codecov-io commented Jul 25, 2016

Current coverage is 85.24% (diff: 100%)

Merging #13775 into master will increase coverage by <.01%

@@             master     #13775   diff @@
==========================================
  Files           140        140          
  Lines         50415      50440    +25   
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
+ Hits          42970      42996    +26   
+ Misses         7445       7444     -1   
  Partials          0          0          

Powered by Codecov. Last update 98c5b88...7c03a72

Copy link
Member

Choose a reason for hiding this comment

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

'column names' -> 'column level names' ? ('column names' sounds like the columns labels itself)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👍 DataFrame.style will now show column level names (e.g. DataFrame.columns.names) (:issue:13775)

BUG: Fix index class level row

MVP

Columns too

tests
Copy link
Contributor

Choose a reason for hiding this comment

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

would add this documenation to the doc-string as well

BUG: Fix CSS classes for index names

Updates

doc2

option

honor options
@jreback
Copy link
Contributor
jreback commented Aug 3, 2016

lgtm. merge away.

@TomAugspurger TomAugspurger deleted the style-sparse-mi-2 branch April 5, 2017 02:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Output-Formatting __repr__ of pandas objects, to_string

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Conditional HTML styling hides MultiIndex structure

4 participants

0