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
[BUG] Misaligned column headers of pandas DataFrame in IPython when using rich.pretty #1256
Comments
The problem is that IPython prints the I'm assuming that IPython has a special case for output that has newlines. If there is a newline character it will start the output on the following line and not the line containing |
That sounds great as far as I'm concerned :) |
Can you give 10.5.0 a try and let me know if that fixes it? |
10.5.0: Fixed Fixed Pandas objects not pretty printing Textualize/rich#1305 Fixed Textualize/rich#1256 Fixed typing with rich.repr.auto decorator Fixed repr error formatting Textualize/rich#1326 Added Added new_line_start argument to Console.print Added Segment.divide method Added Segment.split_cells method Added segment.SegmentLines class
Works like a charm, thank you very much! |
Compare the vanilla
Out[2]
withOut[4]
prettified byrich
: the column headers are no longer right-aligned: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 onrich
's side -- maybe it's an unfortunate interaction betweenrich
,ipython
andpandas
? FWIW, the problem doesn't occur in the regular Python REPL:The text was updated successfully, but these errors were encountered: