Functions like fmt_nanoplot() have arguments that support calculation expressions on data. For example, reference_line= can take arguments like "min", which then calculates the min.
It would be great if we could just take a polars expression there. One issue is that afaik there isn't a way to pass an "anonymous" expression in polars. Meaning, an expression that says "do this set of calculations to some unnamed Series, that will be specified later".
However, a very similar mechanism exists for lists already in polars. You can use polars.element() to essentially do the above, for each list in a column with a schema like List[*].
I wonder if there's a way to tap into this mechanism more generally? E.g.
# pretty good, but not as extensible ---
GT(...).fmt_nanoplot(reference_line="min")
# plz we need it ---
GT(...).fmt_nanoplot(reference_line=pl.element().min())
(I could be missing another feature in polars that does this already)
Functions like
fmt_nanoplot()
have arguments that support calculation expressions on data. For example,reference_line=
can take arguments like "min", which then calculates the min.It would be great if we could just take a polars expression there. One issue is that afaik there isn't a way to pass an "anonymous" expression in polars. Meaning, an expression that says "do this set of calculations to some unnamed Series, that will be specified later".
However, a very similar mechanism exists for lists already in polars. You can use
polars.element()
to essentially do the above, for each list in a column with a schema likeList[*]
.I wonder if there's a way to tap into this mechanism more generally? E.g.
(I could be missing another feature in polars that does this already)