-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
docs(python): Add "See Also" for arg_sort
and arg_sort_by
#15348
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #15348 +/- ##
==========================================
+ Coverage 81.36% 81.37% +0.01%
==========================================
Files 1364 1363 -1
Lines 176615 176803 +188
Branches 2526 2531 +5
==========================================
+ Hits 143696 143876 +180
- Misses 32435 32442 +7
- Partials 484 485 +1 ☔ View full report in Codecov by Sentry. |
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.
Good move adding the See Also - I can see how these functions are related.
py-polars/polars/functions/lazy.py
Outdated
The returned expression's first element is the index of the row with the | ||
lowest value of `exprs` (or highest value if `descending=True`). This row | ||
would be first if the dataframe were sorted on `exprs`. The second element | ||
is the index of the row that would be second if sorted, and so on. |
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.
This honestly doesn't clear anything up for me. I think it should be left out.
Perhaps we can use the code examples to make things a bit clearer, e.g. use a gather
with the output of arg_sort
and show that it's sorted?
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.
Looks good, thanks!
arg_sort
and arg_sort_by
arg_sort
and arg_sort_by
Related to #15316.
I think that
arg_sort
andarg_sort_by
can be a bit confusing in polars, since polars doesn't use much indexing. It might help the docs to link to a relatedgather
method (to usearg_sort
results) or a relatedrank
method (which people might want instead ofarg_sort
).I kept the "See Also" descriptions in line with the method's documentation, but they could reference
arg_sort
/arg_sort_by
instead.