Skip to content
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

Merged
merged 4 commits into from
Mar 28, 2024

Conversation

rob-sil
Copy link
Contributor

@rob-sil rob-sil commented Mar 28, 2024

Related to #15316.

I think that arg_sort and arg_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 related gather method (to use arg_sort results) or a related rank method (which people might want instead of arg_sort).

I kept the "See Also" descriptions in line with the method's documentation, but they could reference arg_sort/arg_sort_by instead.

@github-actions github-actions bot added documentation Improvements or additions to documentation python Related to Python Polars labels Mar 28, 2024
Copy link

codecov bot commented Mar 28, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 81.37%. Comparing base (2de5764) to head (b7d92c4).
Report is 28 commits behind head on main.

❗ Current head b7d92c4 differs from pull request most recent head 29ccaa0. Consider uploading reports for the commit 29ccaa0 to get more accurate results

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.
📢 Have feedback on the report? Share it here.

Copy link
Member

@stinodego stinodego left a 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.

Comment on lines 1544 to 1547
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.
Copy link
Member

@stinodego stinodego Mar 28, 2024

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?

@rob-sil rob-sil requested a review from reswqa as a code owner March 28, 2024 14:30
Copy link
Member

@stinodego stinodego left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks!

@stinodego stinodego changed the title docs(python): add "See Also" for arg_sort and arg_sort_by docs(python): Add "See Also" for arg_sort and arg_sort_by Mar 28, 2024
@stinodego stinodego merged commit a871359 into pola-rs:main Mar 28, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation python Related to Python Polars
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants