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
the right index should be array([6,0,4,1,3,5,2]),so I find a error rule that function argsort() will display the wrong index when an array that starts with a maximum and has an odd number of elements.
Reproducing code example:
>>>fromnumpyimport*>>>a=array([4,2,3,1])
>>>argsort(a)
array([3, 1, 2, 0], dtype=int64)
### so this is right, it returned the sorted index. but the follow example is wrong:>>>a=array([4,2,3])
>>>argsort(a)
array([1, 2, 0], dtype=int64)
### the right index should be array([2,0,1]),and the follow example is also wrong:>>>a=array([5,1,4,3,2])
>>>argsort(a)
array([1, 4, 3, 2, 0], dtype=int64)
### the right index should be array([4,0,3,2,1]),and the follow example is also wrong:>>>a=array([7,1,5,2,4,6,3])
>>>argsort(a)
array([1, 3, 6, 4, 2, 5, 0], dtype=int64)
Error message:
Numpy/Python version information:
Numpy 1.13.3/Python 3.5.2
1.13.3 3.5.2 (v3.5.2:4def2a2901a5, Jun 25 2016, 22:18:55) [MSC v.1900 64 bit (AMD64)]
The text was updated successfully, but these errors were encountered:
the function argsort() returns a wrong indice that would sort an array.
for example:
so this is right, it returned the sorted index. but the follow example is wrong:
the right index should be array([2,0,1]),and the follow example is also wrong:
the right index should be array([4,0,3,2,1]),and the follow example is also wrong:
the right index should be array([6,0,4,1,3,5,2]),so I find a error rule that function argsort() will display the wrong index when an array that starts with a maximum and has an odd number of elements.
Reproducing code example:
Error message:
Numpy/Python version information:
Numpy 1.13.3/Python 3.5.2
1.13.3 3.5.2 (v3.5.2:4def2a2901a5, Jun 25 2016, 22:18:55) [MSC v.1900 64 bit (AMD64)]
The text was updated successfully, but these errors were encountered: