isort#

swordfish.function.isort()#

Instead of returning a sorted vector like sort_, isort returns the indexes in the original vector for each element in the sorted vector.

X[F.isort(X)] is equivalent to sort_(X).

Parameters:
  • X (Constant) – A vector or a tuple of vectors of the same length.

  • ascending (Constant) – A Boolean scalar or vector indicating whether to sort X (or vectors of X sequentially) in ascending order or descending order. The default value is true (ascending order).