Skip to content

[BUG] Misaligned column headers of pandas DataFrame in IPython when using rich.pretty #1256

@dlukes

Description

@dlukes

Compare the vanilla Out[2] with Out[4] prettified by rich: the column headers are no longer right-aligned:

ipython

The fix should be easy -- just make rich put the column headers on a separate line, like the vanilla representation. But maybe there's a catch? One thing that comes to mind is that maybe this can't be fully fixed on rich's side -- maybe it's an unfortunate interaction between rich, ipython and pandas? FWIW, the problem doesn't occur in the regular Python REPL:

python

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions