Comments (9)
Would you be open to changing the default number of printed rows from 8 to 10?
Apparently so 😎 #13699
from polars.
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.
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.
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.
Would you be open to changing the default number of printed rows from 8 to 10?
from polars.
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.
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.
@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.
My vote here is:
- 10 rows for
head
andtail
- 10 rows for
limit
- first 5 and last 5 for
__str__
from polars.
Related Issues (20)
- Schema of `LazyFrame.with_context` does not match result of collect HOT 2
- Following a selector with .exclude() is not considered a selector HOT 6
- predicate pushdown with `pl.Expr.cut`
- `.list.to_struct()` has non-deterministic behavior HOT 5
- Add `Expr.list.map_elements(func)` to perform a custom function on every element in a list HOT 2
- pl.from_pandas(..., nan_to_null=True) does not convert NaN to Null HOT 3
- Example of `.over()` 900x slower than group_by.agg.join (and over 50x slower than pandas) HOT 6
- Non-deterministic failure when materializing LazyFrame
- LazyFrame - Unnested columns are missing in Lazy Frame HOT 5
- Add section about using `pipe` to the user guide HOT 1
- Regression: `list.sum()` inside WhenThen now returns a list HOT 1
- In pl.Series, nan_to_null parameter not respected with floats HOT 1
- When reading excel table data, you are advised to freely select the column name or column number to read data HOT 2
- When reading excel table data, allow selection of the column names/indices to read HOT 2
- Incorrect `ColumnNotFound` panic, which occurs only for LazyFrames HOT 2
- search_sorted does not work on boolean columns
- PanicException creating DataFrame with numpy array inside dict HOT 1
- `struct.rename_fields` does not work on structs with categorical columns after scanning a parquet file with more than one row group. HOT 4
- `SchemaFieldNotFound` on LazyFrame when using `select` after `struct.field(...)` HOT 1
- Handle `pd.NaT` values in lists passed to DataFrame constructor HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from polars.