-
-
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
Make head(), tail() and limit() return the same number of rows for Expr, Series, DataFrame and LazyFrame #13445
Comments
I like 5. The point is to see what the table looks like (columns, dtypes, reasonable samples of data). and adding more rows than that might make you scroll up in a smallish terminal. |
I don't think we need to pick one at all. One is a single column while the other is a 2D table. 10 rows of a dataframe is a lot of information, 10 elements of a column not so much. There is also something to be said for having the same value across data types, but it's not so black and white as you make it out to be. |
I would argue for either using 5 for all, or changing the default number of printed rows. Currently you can't see the intermediate rows with Expr.head(): >>> pl.DataFrame(range(100)).select(pl.all().head())
shape: (10, 1)
┌──────────┐
│ column_0 │
│ --- │
│ i64 │
╞══════════╡
│ 0 │
│ 1 │
│ 2 │
│ 3 │
│ … │
│ 6 │
│ 7 │
│ 8 │
│ 9 │
└──────────┘ |
Would you be open to changing the default number of printed rows from 8 to 10? |
Apparently so 😎 #13699 |
Love it!! Ok so at this point I would definitely advocate for |
Counter-argument: in those 10 rows we're displaying the equivalent of |
@alexander-beedie very good point. No matter what |
My vote here is:
|
Description
Expr.head() and Series.head() return 10 rows by default, while DataFrame.head() and LazyFrame.head() return 5 rows. We should pick one ;)
We should do the same for tail() and limit().
The text was updated successfully, but these errors were encountered: