⍒

Grade Down R←⍒Y

Y may be any array of rank greater than 0 but may not contain namespaces. R is an integer vector being the permutation of ⍳1↑⍴Y that places the sub-arrays along the first axis in descending order. For the rules for comparing items of Y with one another, see Grade Up.

βŽ•IO is an implicit argument of Grade Down.

Examples

      ⍒22.5 1 15 3 Β―4
1 3 4 2 5
      M
2 3 5
1 4 7

2 3 4
5 2 4

2 3 5
1 2 6
      ⍒M
1 3 2

Note

Character arrays sort differently in the Unicode and Classic Editions.

      M
Goldilocks
porridge   
Porridge   
3 bears 
Unicode Edition Classic Edition
      ⍋M
2 3 1 4
      ⍋M
3 1 4 2
      M[⍋M;]
porridge
Porridge
Goldilocks
3 bears
      M[⍋M;]
Porridge
Goldilocks
3 bears
porridge
      ⍴pb
6 3
      pb
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”
β”‚Rivers  β”‚Jasonβ”‚554β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€
β”‚Daintreeβ”‚John β”‚532β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€
β”‚Rivers  β”‚Jasonβ”‚543β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€
β”‚Foad    β”‚Jay  β”‚558β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€
β”‚Scholes β”‚John β”‚547β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€
β”‚Scholes β”‚John β”‚535β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”˜
      ⍒pb
5 6 1 3 4 2