-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
Styler class should have a pipe()
method, akin to DataFrame.pipe()
#23229
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
Comments
I think this proposition seems reasonable, unless there is some workaround already. |
Thanks very much, @gfyoung, for the feedback and the review on the corresponding pull request (#23384). I can elaborate on the two major use cases I had in mind for this: II. As a variant of (I), users may find themselves attempting to style many different views of data in a consistent way within a notebook. For example, users might want to present two different kinds of results (e.g. summary results and detailed results) while grouping by three different columns in their data frame, for a total of six tables being created/styled. In that case, the Here's an example (untested code). Note that in general, there may be a series of operations performed on a data frame to get the final result frame, before any styling is applied.
|
@nmusolino : Thanks for the explanation! Now if you could take some of this and put it in the whatsnew, that would be great. 👍 |
* Add Styler.pipe() method, akin to DataFrame.pipe()
* Add Styler.pipe() method, akin to DataFrame.pipe()
Uh oh!
There was an error while loading. Please reload this page.
Problem description
Users may want to create functions that apply customized styling to a dataframe or styler object.
In order to make these functions composable, a convenient signature is
f(styler) -> Styler
, so that a user can chain multiple such functions together, in a "mix-and-match" fashion. (N.B. Such functions can obtain the underlying dataframe using thestyler.data
attribute.)A method
Styler.pipe()
would provide an ergonomic way to apply these functions sequentially, after a series of Dataframe-related manipulations.Usage example:
The text was updated successfully, but these errors were encountered: