Giter VIP home page Giter VIP logo

Comments (9)

alexander-beedie avatar alexander-beedie commented on May 25, 2024 4

Would you be open to changing the default number of printed rows from 8 to 10?

Apparently so 😎 #13699

from polars.

mcrumiller avatar mcrumiller commented on May 25, 2024 1

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.

from polars.

stinodego avatar stinodego commented on May 25, 2024

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.

from polars.

Wainberg avatar Wainberg commented on May 25, 2024

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        │
└──────────┘

from polars.

Wainberg avatar Wainberg commented on May 25, 2024

Would you be open to changing the default number of printed rows from 8 to 10?

from polars.

Wainberg avatar Wainberg commented on May 25, 2024

Love it!!

Ok so at this point I would definitely advocate for head(), tail() and limit() to return 10 rows instead of 5. I'm sympathetic to Stijn's argument that 10 rows of a DataFrame can be more of an 'information overload' than 5 rows, but if we're now printing 10 rows of a DataFrame by default, may as well do the same for head() etc.

from polars.

alexander-beedie avatar alexander-beedie commented on May 25, 2024

if we're now printing 10 rows of a DataFrame by default, may as well do the same for head() etc.

Counter-argument: in those 10 rows we're displaying the equivalent of head(5) and tail(5) once the total number of rows >= 10, so it can also be argued that it is consistent to keep that correspondence (I'm relatively neutral, though lean towards keeping frame head/tail at 5 for that reason as well as @stinodego's 😉).

from polars.

mcrumiller avatar mcrumiller commented on May 25, 2024

@alexander-beedie very good point. No matter what n we pick for head and tail, we must show 2n+1 or 2n-1 rows in df.__str__() without an asymmetric head/tail (if we want to show the same information).

from polars.

mcrumiller avatar mcrumiller commented on May 25, 2024

My vote here is:

  • 10 rows for head and tail
  • 10 rows for limit
  • first 5 and last 5 for __str__

from polars.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.