You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Will print <Array [[]] type='1 * var * float64'>, which has the value type float64 instead of int64. It works normally (returning int64) if arr is not empty. If you try to use this result to sort arr, you will get ValueError: only arrays of integers or booleans may be used as a slice.
Related to this I noticed that the following does not raise an error, even though argsort still returns floats here
arr=ak.Array([])
arr[ak.argsort(arr)]
I'm not sure if this is to be expected.
Tested on the latest git main (1.2.0rc2).
The text was updated successfully, but these errors were encountered:
jpivarski
added
bug
The problem described is something that must be fixed
and removed
bug (unverified)
The problem described would be a bug, but needs to be triaged
labels
Feb 22, 2021
Thanks; that was just an oversight in the definition of EmptyArray::argsort_next.
The second example probably should be raising an error because the type is wrong—it certainly does when the array is not empty. It's complicated by the fact that EmptyArray declares itself to be an array of integers when used in a slice, but an array of floats when used in other contexts (except ak.argsort, after PR #764 goes through), though I think your example has an empty NumpyArray, rather than an EmptyArray. As for that case, I think it would be better for it to be picky about the type, even if the array is empty, but it's pretty low priority.
Will print
<Array [[]] type='1 * var * float64'>
, which has the value typefloat64
instead ofint64
. It works normally (returningint64
) ifarr
is not empty. If you try to use this result to sortarr
, you will getValueError: only arrays of integers or booleans may be used as a slice
.Related to this I noticed that the following does not raise an error, even though
argsort
still returns floats hereI'm not sure if this is to be expected.
Tested on the latest git main (1.2.0rc2).
The text was updated successfully, but these errors were encountered: