You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the current doc of the selectors, there is no example on how to use filters with selectors. At first I thought it was not possible but there was a PR that made it possible.
I think it would be important to add at least one example to help readers understand how to use them together, I made several attempts before finding the solution
I need your help to understand what you are saying better.
Before finding the PR you linked, why did you think you couldn't use polars.selectors inside filter?
In what scenarios did you think you could use polars.selectors?
Your answers to these questions will help us improve the documentation.
there were no example of pl.selectors being used with a .filter in the doc page
I didn't find examples on stackoverflow
I tried to do something like ((pl.selectors.starts_with("test_)>3).any()) or other combination
Now that I know how to do it, it seems indeed obvious that I had to test it using a horizontal function, however it was not obvious for me at first and it could be the same for other people
I think I could therefore use the polars.selectors to select multiple columns in a .select(), .with_columns() or .group_by and .agg() but those are straightforward and do not need more examples
We saw that we can use selectors with filters, but we have to be aware that it will create one boolean expression for each column selected and we should specify how to combine them (using pl.any_horizontal() or pl.all_horizontal()) (this is not specified in the page)
At some point I tried to use pl.when() with the selectors but did not succeeded , maybe I should try again with a horizontal function , but this could be nice to show an example of how to do it, or explain that it cannot be used
Description
In the current doc of the selectors, there is no example on how to use filters with selectors. At first I thought it was not possible but there was a PR that made it possible.
Here is the working example :
I think it would be important to add at least one example to help readers understand how to use them together, I made several attempts before finding the solution
Link
https://docs.pola.rs/api/python/stable/reference/selectors.html
The text was updated successfully, but these errors were encountered: