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)
- (lazy only) Cannot select same value from different enums in separate when/then chains in the same `select `statement HOT 1
- `search_sorted` does not handle series sorted with `nulls_last=True`
- Default to Arrow String type instead of LargeString HOT 4
- Streaming sort silently ignores `nulls_last=True`
- Streaming version of polars.LazyFrame.count produces a wrong result when used in aggregation
- Support for the default datetime fmt when using .cast(pl.Datetime)
- Unsorted min/max on all-NaN array returns inf/-inf HOT 1
- pl.read_database() error suggests increasing `infer_schema_length` - but no such option exists HOT 2
- dtype is upcasted silently in `list.concat`
- Inappropriate result of expr `skew` and `kurtosis` for a magic constant inputs
- when/then/otherwise for arrays does not work
- Selecting null values from an object column makes the process unresponsive HOT 1
- `concat` failure in `0.20.16rc` HOT 2
- pl.StringCache() is not re-entrant HOT 5
- Inconsistent behavior of `pl.element().replace()`: Works for list of integers, crashes for list of strings HOT 2
- pl.Expr.get(pl.Expr.arg_min()) does not respect rolling window HOT 2
- map_dict(..., default=pl.first()) keeps the wrong column HOT 3
- Pathological slowdown in `LazyFrame.group_by_dynamic` with simple input HOT 11
- No deprecation warning, while calling a function of an imported module HOT 3
- Object Series with string elements converts to pyarrow FixedSizeBinaryArray, not LargeStringArray
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.