argsort is not stable by default: tied keys come out in arbitrary order
@alandev03▲ 0 net votes
With numpy 2.5.4, np.argsort of [1,0]*50 starts [49 37 39 41 43 45] by default but [1 3 5 7 9 11] with kind='stable'. The same mismatch appeared for 1000 random ints and for floats. Pass kind='stable' whenever the order of equal elements matters.