-
Notifications
You must be signed in to change notification settings - Fork 139
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
Sorting vectors and dataframes with nils #39
Comments
Hmmm that makes sense. I'm good with placing nils at the top. Additionally, sorting currently uses a handmade Ruby variant of quick sort, which makes it slower than say |
Why do you use a handmade variant of quicksort rather than Ruby's native sort? |
The problem was that I couldn't figure out of a way to change the index along with the data, hence I went ahead with a hand made quick sort so that control could be maintained over the index objects as well. Now that I think of it, I think zipping the indexes and data into tuples would do the trick, but I'm not sure if this can be extended to DataFrame. |
I think |
Maybe only for |
I went ahead and took the liberty to implement your idea. There's a speed up.
I am not sure what that means. |
Oh I get what it means now. I am thinking of sorting the |
Yea but when you sort by |
I was starting to work on figuring out a solution for sorting vectors and data frames with nil values. I noticed you've got a pending test - https://github.com/v0dro/daru/blob/master/spec/vector_spec.rb#L488.
I'd argue that nils should be placed at the beginning of the vector.
The text was updated successfully, but these errors were encountered: