-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
fix(rust,python): Improve printing controls of DataFrame and Series #5047
Conversation
Nice! Do you think you could tweak the "all rows" value to (On a more realistic note, I can imagine that there may be some --admittedly odd!-- edge-cases where you might actually want to return tables with no rows; overriding zero to mean "all" leaves no way to do so). |
Fair enough. For the sake of consistency I will make setting rows (cols) to any negative number (-1,-2,etc) to print all the rows (cols) in a DataFrame or Series. |
Config.set_tbl_rows
control printing Series too.
fixes pola-rs#5046 (1) Let polars.Config.set_tbl_rows to control maximum number of elements when printing Series (in general any Series => str conversion). Works the same way as when printing DataFrame. (2) Calling polars.Config.set_tbl_rows or polars.Config.set_tbl_cols with any negative integer (-1 is recommended) will cause all the rows (DataFrame and Series) or all the columns (DataFrame) be printed.
Actually, in the current polars (as of polars/polars/polars-core/src/fmt.rs Lines 344 to 348 in 1968f3f
|
1e6ec5a
to
6d6a3b2
Compare
Config.set_tbl_rows
control printing Series too.
Just updated the PR with the requested changes. While at that I squashed all the commits into one and rebased it onto the latest |
Al right. Thanks! |
@ritchie46: Thanks for promptly merging it in! |
Very peculiar :) |
fixes #5046
(1) Let polars.Config.set_tbl_rows to control maximum number of
elements when printing Series (in general any Series => str conversion).
Works the same way as when printing DataFrame.
(2) Calling polars.Config.set_tbl_rows or polars.Config.set_tbl_cols with
any negative integer (-1 is recommended) will cause all the rows
(DataFrame and Series) or all the columns (DataFrame) be printed.