-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
feat(python): Change default number of rows printed in Notebooks for DataFrame/Series to 10 #14536
Conversation
Let's go for that. Too much vertical scrolling in a Notebook is annoying.
There are some off-by-one errors... I think I may address the HTML ones here actually if I have time, otherwise it can be a separate PR. |
half, rest = divmod(max_rows, 2) | ||
self.row_idx = [ | ||
*list(range(max_rows // 2)), | ||
*list(range(half + rest)), | ||
-1, | ||
*list(range(df.height - max_rows // 2, df.height)), | ||
*list(range(df.height - half, df.height)), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This makes sure display is correct when the limit is odd - e.g. if the limit is 9, we get 5 rows displayed, then ...
, then the last 4 rows.
max_rows = int(os.environ.get("POLARS_FMT_MAX_ROWS", default=25)) | ||
max_cols = self.width | ||
|
||
max_rows = int(os.environ.get("POLARS_FMT_MAX_ROWS", default=10)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Default was changed here from 25 to 10.
Closes #14515
Changes
2010 also.I guess we could also do 10 rows for both?