-
-
Notifications
You must be signed in to change notification settings - Fork 18.1k
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
ENH: Option to configure line wrapping for columns #59564
Comments
Thanks for the request. Why does the line wrapping cause an issue for you? |
It could be my personal preference only, but I found reading things on 1 line is easier on my eyes. I have crafted an example for you to better illustrate. Here is some data when I use Everything shows up nicely. But there is one review where it's very long (hence ellipsis) and I need to change Now all of its contents are shown, but suddenly everything else is squished together and makes it hard to read, even though there is plenty of room left. The linewrapping behaviour here is unexpected because I only need the rightmost column to expand and show the long review. Also, when you specify a very large column width, logically it should show the column contents on 1 line, not condense and linewrap it (which is only appropriate if column width is small). That's why I think there should be an option to control this behaviour. |
I can see the preference for not having line breaks, and could buy that with line breaks is harder, but I do not think this is hard to read. At a glance, it seems to me the additional complexity in output formatting is not worth the gain here. If it could be shown that this change can be made with negligible additional complexity to the current set of features, I could be swayed otherwise. |
Yeah the automatic linewrapping is generally a non-issue for me. Only in some occasions where it brings unexpected changes, I do feel like we could have some more control there. But if the option addition complicated the code base, I also agree to not implement at all. Hopefully I could find a simple solution for this when I have some spare time. |
Feature Type
Adding new functionality to pandas
Changing existing functionality in pandas
Removing existing functionality in pandas
Problem Description
When having large enough
display.max_colwidth
value and a column contains cells with long data, other columns with shorter data will get their content (containing whitespaces) line-wrapped, even though there is plenty of space left and also a scrollbar to accommodate the large DataFrame width.This can be reproduced using the snippet below:
I want to make the
column name
shown on 1 line, instead of being line-wrapped to 2 lines. There isn't limited space here so I think linewrapping is unnecessary for such short data. I have searched in Pandas "Options and Settings" page) and there is currently no option to configure this behaviour. I would be really grateful if this gets implemented.Feature Description
Add a new option to configure linewrapping behaviour for columns, e.g.
display.linewrap
that accepts boolean values,True
to enable linewrapping andFalse
otherwise.Alternative Solutions
None
Additional Context
No response
The text was updated successfully, but these errors were encountered: