Up Arrow (โ†‘)

โ†‘ ๐•ฉ: Prefixes

Prefixes of array ๐•ฉ along its first axis.

โ†—๏ธ
       โ†‘ 1โ€ฟ2โ€ฟ3โ€ฟ4
โŸจ โŸจโŸฉ โŸจ 1 โŸฉ โŸจ 1 2 โŸฉ โŸจ 1 2 3 โŸฉ โŸจ 1 2 3 4 โŸฉ โŸฉ

       a โ† 3โ€ฟ3 โฅŠ โ†•9

       โ†‘ a
โ”Œโ”€                                    
ยท โ†•0โ€ฟ3 โ”Œโ”€        โ”Œโ”€        โ”Œโ”€         
       โ•ต 0 1 2   โ•ต 0 1 2   โ•ต 0 1 2    
               โ”˜   3 4 5     3 4 5    
                         โ”˜   6 7 8    
                                   โ”˜  
                                     โ”˜

๐•จ โ†‘ ๐•ฉ: Take

For each integer in ๐•จ, take that many elements from each dimension of ๐•ฉ.

Negative numbers take from the end.

If any of the elements in ๐•จ are greater than the length of their respective dimension, the dimension is extended with a fill value.

โ†—๏ธ
      3 โ†‘ 1โ€ฟ3โ€ฟ5โ€ฟ67
โŸจ 1 3 5 โŸฉ

      a โ† 4โ€ฟ4 โฅŠ โ†•16
Error: Redefinition

      3โ€ฟ3 โ†‘ a
โ”Œโ”€       
โ•ต 0 1 2  
  3 4 5  
  6 7 8  
        โ”˜

      5โ€ฟ5 โ†‘ a
โ”Œโ”€           
โ•ต 0 1 2 0 0  
  3 4 5 0 0  
  6 7 8 0 0  
  0 0 0 0 0  
  0 0 0 0 0  
            โ”˜

      3โ€ฟยฏ3 โ†‘ a
โ”Œโ”€       
โ•ต 0 1 2  
  3 4 5  
  6 7 8  
        โ”˜