ShengweiAn:

In my option, if sorted=False , then the returned indices should be sorted, that is the elements in the indices are ascending.


I’m not sure I can follow your assumption.
Why would you expect the output to be sorted, when you specify sorted=False?
Are you seeing the expected result using sorted=True?