sort and partsort arguments

22 views
Skip to first unread message

dbv

unread,
Apr 22, 2014, 11:54:17 AM4/22/14
to bottl...@googlegroups.com
For an array of length m, bottleneck.partsort(arr, n) returns the n smallest elements at the beginning of the array which can be captured with bottleneck.partsort(arr, n)[:n]

The largest n elements are returned at the end of the array with bottleneck.partsort(arr, m-n), which can be captured with bottleneck.partsort(arr, m-n)[-n:]

If so, would it be easier to support:

bottleneck.partsort(arr, n) and bottleneck.partsort(arr, n)[:n] to return the smallest n elements

and

bottleneck.partsort(arr, -n) and bottleneck.partsort(arr, n)[n:] to return the largest n elements

Reply all
Reply to author
Forward
0 new messages