-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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,rust): raise default frame/series repr height from 8 to 10 #13699
feat(python,rust): raise default frame/series repr height from 8 to 10 #13699
Conversation
I think this is a good change. I'm not sure what the rationale was for the existing behavior - something with display in notebooks? I don't know. But the proposed change sounds fine to me 👍 |
Related #13445. |
42befa2
to
af37a9b
Compare
Probably should have @ritchie46 sign off on this one, but looks good to me! |
Can you mention this PR as a comment. Then from now on, we know the rationale behind our choice. :) The rationale behind 8 was just me choosing something reasonable, I think. In any case. Fine by me. 👍 |
Good plan; done ;) |
@alexander-beedie the default for Series is still 26 rows, should this also be changed to 10? >>> pl.Series(range(1, 26 + 1))
shape: (26,)
Series: '' [i64]
[
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
]
>>> pl.Series(range(1, 27 + 1))
shape: (27,)
Series: '' [i64]
[
1
2
3
4
5
6
7
8
9
10
11
12
…
15
16
17
18
19
20
21
22
23
24
25
26
27
] |
Very minor change, but I received a few comments about this recently and I tend to agree with the idea. It is simply a small adjustment to favour the common case of being intrinsically more interested in a top 10 than a top 8.
Let's see what everyone thinks ;)
The change
Why?
Wanting to look at a top/bottom 5 or a top 10 feels much more common than wanting to look at a top 4 or a top 8. Maybe this is down to humans having 5 fingers per hand, the decimal system, or something else, but there aren't a whole lot of "top 8" lists out there compared to "top 10" lists. The world seems used to thinking about result sets of this size, and there is little harm going with the flow here.
I present the following incredibly rigorous scientific evidence in the form of "number of search results returned from Google" for the quoted search terms "top 8" vs "top 10" 😉
Note that "top 5" also significantly outpaces both "top 8" and "top 4" (so when we do truncate, presenting the top/bottom 5 (which is what truncation would leave us with if our default total changes to 10 rows) is likely preferable over top/bottom 4, particularly during interactive exploration:
(Chart showing number of Google search results for "top n" search terms; note the huge spikes at 5 and 10).
How this manifests
Something like
df.head(10)
won't show you all of the results, for example:Top 10 Netflix (English) films this week
Current (can't actually see the whole top 10)
Proposed (top 10 visible without truncation)
I think this is somewhat trivial, but also actually worthwhile; any additional thoughts, disagreements? 😄