Thanks to visit codestin.com
Credit goes to github.com

Skip to content

BUG: numpy.argsort  #22020

Closed as not planned
Closed as not planned
@MrTheyosyos

Description

@MrTheyosyos

Describe the issue:

wrong output.

Reproduce the code example:

import numpy as np

mat = np.array([[7,5,1,6],[1,9,8,2],[2,7,3,8]])

mat
>>array([[7, 5, 1, 6],
         [1, 9, 8, 2],
         [2, 7, 3, 8]])

np.argsort(mat, axis=1)
>>array([[2, 1, 3, 0],
         [0, 3, 2, 1],
         [0, 2, 1, 3]])


# expected:
array([[3, 1, 0, 2],
       [0, 3, 2, 1],
       [0, 2, 1, 3]])

Error message:

No response

NumPy/Python version information:

Name: numpy
Version: 1.22.3
Summary: NumPy is the fundamental package for array computing with Python.
Home-page: https://www.numpy.org
Author: Travis E. Oliphant et al.
Author-email:
License: BSD

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions