Skip to content

DataArray.sort_values() #5795

Answered by max-sixty
raybellwaves asked this question in Ideas
Sep 14, 2021 · 1 comments · 2 replies
Discussion options

You must be logged in to vote

I agree that da_1d.sortby(da_1d) could be simpler. Some options:

  • da_1d.sortby() could work for 1d arrays? Generally we try to not special-case by dimension number though
  • da_1d.sortby(lambda x: x) could be a nice general solution (it's already possible to pass lambdas to methods like where), though maybe not that friendly to newcomers.

I'm not sure it's worth another method — as you point out — it duplicates another method, and could make it confusing on which to use.

What are your thoughts @raybellwaves ?

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@raybellwaves
Comment options

@dcherian
Comment options

Answer selected by raybellwaves
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Ideas
Labels
None yet
3 participants