Skip to content

Missing ellipsis cells in pivot_table.to_html when limited by max_cols and len(rows) > 1 #6131

Closed
@BertrandBordage

Description

@BertrandBordage
import pandas
df = pandas.DataFrame([
    {'a': 'aa', 'b': 'ba', 'c': 'ca', 'd': 1},
    {'a': 'ab', 'b': 'bb', 'c': 'cc', 'd': 2},
    {'a': 'ac', 'b': 'bc', 'c': 'cc', 'd': 3}
])

df.pivot_table(cols=['a'], rows=['b', 'c']).to_html(max_cols=2)

This renders like this:
broken_output

while this:

df.pivot_table(cols=['a'], rows=['b']).to_html(max_cols=2)

renders like this:
slection_656

As you can see in the first table, there are no ellipsis cells like in the second one.
I inspected the code to find the reason for this bug but couldn't find…

Metadata

Metadata

Assignees

No one assigned

    Labels

    IO HTMLread_html, to_html, Styler.apply, Styler.applymapOutput-Formatting__repr__ of pandas objects, to_stringTestingpandas testing functions or related to the test suitegood first issue

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions