Comments (6)
df.head(20).to_string()
from polars.
Or even just df[:20].to_string()
:)
@DeflateAwning: can already achieve this cleanly - doesn't really seem to be any need (or subsequent advantage) for moving the "head" (or "slice") call inside to_string
. I don't think we do that anywhere else, so makes sense to keep things consistent/composable here 🤔
from polars.
Hmm I'm not sure we're talking about the same thing.
In Python:
In [1]: df = pl.DataFrame([{'id': i} for i in range(30)])
In [2]: df
Out[2]:
shape: (30, 1)
┌─────┐
│ id │
│ --- │
│ i64 │
╞═════╡
│ 0 │
│ 1 │
│ 2 │
│ 3 │
│ 4 │
│ … │
│ 25 │
│ 26 │
│ 27 │
│ 28 │
│ 29 │
└─────┘
# Snly 10 rows are visible. I want all 20 rows to be visible.
print(str(df.head(20)))
shape: (20, 1)
┌─────┐
│ id │
│ --- │
│ i64 │
╞═════╡
│ 0 │
│ 1 │
│ 2 │
│ 3 │
│ 4 │
│ … │
│ 15 │
│ 16 │
│ 17 │
│ 18 │
│ 19 │
└─────┘
In Rust, I assume the same thing happens.
I see now that the config page has this example:
with pl.Config(tbl_rows=2):
print(df)
This is what I was looking for in Python.
In Rust however, I don't see an equivalent set_tbl_rows
: search. Any advice?
from polars.
It looks like it sets an env variable:
polars/py-polars/polars/config.py
Line 1186 in 0c37ead
Which I guess is done with std::env
in Rust?
from polars.
This seems like a bizarre way to communicate what, in my opinion, should be a simple argument.
Imagine if .dt.strftime(...)
communicated the date format via an environment variable.
from polars.
It's very possible I'm missing something here - this was just what I found when trying to figure out how it currently works in py-polars
I'm guessing that eventually the Rust API will have a pl.Config
equivalent?
from polars.
Related Issues (20)
- Non-deterministic failure when materializing LazyFrame
- LazyFrame - Unnested columns are missing in Lazy Frame HOT 4
- 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
- `.struct.field("*")` PanicException: no `columns` expected at this point
- unique + cross-join PanicException on streaming engine
- Odd result from `.list.sum()` HOT 1
- Filter on chunked DataFrame that removes data in one chunk drops all data in DataFrame when filtering based on categorical struct col HOT 1
- Backfill based on rows HOT 1
- Add a `pl.sql` method for running SQL commands
- polars can no longer find column in LazyFrame HOT 2
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.