Skip to content

np.argsort not sorting properly #405

@tk4218

Description

@tk4218

I am attempting to call np.argsort() on the following array:
[0.700656592845917, 0.651415288448334, 0.719015657901764] dtype = Double

The expected result should be:
[1, 0, 2]

However, the actual result I'm getting is:
[0, 2, 1]

This doesn't to produce a result that is sorted in any direction. I pulled in ndarray.argsort locally and changed line 31 -
from: var data = Array;
to: var data = ToArray<T>()
(Also changing the declaration of the function to include where T : unmanaged )

And this seemed to work for me.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions