-
-
Notifications
You must be signed in to change notification settings - Fork 18.1k
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
ENH: set render limits on Styler
to automatically trim dataframes
#41635
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not but on yet another option as we already have display.max_columns but i suppose ok
doc/source/user_guide/options.rst
Outdated
@@ -487,6 +487,8 @@ styler.sparse.index True "Sparsify" MultiIndex displ | |||
elements in outer levels within groups). | |||
styler.sparse.columns True "Sparsify" MultiIndex display for columns | |||
in Styler output. | |||
styler.max.elements 262144 Maximum number of datapoints that Styler will render |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
styler.display.max_elements ? i think something like that is more instructive no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or
styler.render.max_elements (as all things are display based)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agreed, even maybe styler.max_elements
, but changed to yours
thanks @attack68 |
Styler
to avoid browser crash #40712 also linking CLN/API: implemented to_html in terms of .style #11700Adds an option:
styler.max.elements
with a default value of 2**18 = 262144.Even though this is a 'large' dataframe it is reduced to the max elements and still renders in reasonable time (4s plus about 5s for a browser to render the date).
If the number of data elements exceeds the max then the right side, or bottom, or both of the DataFrame will be trimmed (starting with the largest axis and recursively reducing), leaving '...' filler indicators.
All reduction takes place before index or data looping so it avoids any crashes.