When you have an n-array, you can access each nesting level using the appropriate rank.
Ranks / Forms NOUN
First you have atoms (rank 0):
a =: 1
their form ( $a ) is empty.
Then you have lists (rank 1), which are just a few atoms:
b =: a,a,a b =: 3
their form ( $b ) is the length of the list.
$b 3
Then the tables (rank 2): lists are put together ( file or otherwise):
c =: b,.b,.b
their form is a list of 2 elements: rows, columns.
$c 3 3
Then to rank-n array (rank n).
VERB rank
The rank of the verb is a slightly different story. This is the rank on which the verb will be applied. So, when you use the box-0 ( <"0 ) noun, you always put the atoms of that noun, when you use box-1 ( <"1 ), you always list the noun, etc. For instance:
]n =: 2 3 4 $ i.24 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
0-rank:
<"0 n ββββ¬βββ¬βββ¬βββ β0 β1 β2 β3 β ββββΌβββΌβββΌβββ€ β4 β5 β6 β7 β ββββΌβββΌβββΌβββ€ β8 β9 β10β11β ββββ΄βββ΄βββ΄βββ ββββ¬βββ¬βββ¬βββ β12β13β14β15β ββββΌβββΌβββΌβββ€ β16β17β18β19β ββββΌβββΌβββΌβββ€ β20β21β22β23β ββββ΄βββ΄βββ΄βββ
1st rank:
<"1 n βββββββββββββ¬ββββββββββββ¬ββββββββββββ β0 1 2 3 β4 5 6 7 β8 9 10 11 β βββββββββββββΌββββββββββββΌββββββββββββ€ β12 13 14 15β16 17 18 19β20 21 22 23β βββββββββββββ΄ββββββββββββ΄ββββββββββββ
2nd rank:
<"2 n βββββββββββ¬ββββββββββββ β0 1 2 3β12 13 14 15β β4 5 6 7β16 17 18 19β β8 9 10 11β20 21 22 23β βββββββββββ΄ββββββββββββ
3 ranks:
<"3 n βββββββββββββ β 0 1 2 3β β 4 5 6 7β β 8 9 10 11β β β β12 13 14 15β β16 17 18 19β β20 21 22 23β βββββββββββββ
In this example, ranks above 3 are 3.
You can also use negative ranks, btw, which count back from the highest rank.
You can also mix rows.
Summation
Now you can see how to change the rank +/ , changes the result of the summation. For example, +/"1 summarizes each rank-1 list:
<"1 n βββββββββββββ¬ββββββββββββ¬ββββββββββββ β0 1 2 3 β4 5 6 7 β8 9 10 11 β βββββββββββββΌββββββββββββΌββββββββββββ€ β12 13 14 15β16 17 18 19β20 21 22 23β βββββββββββββ΄ββββββββββββ΄ββββββββββββ +/"1 n 6 22 38 54 70 86
To summarize the rank-n array, you must do n +/ s:
(+/^:3) n 276 +/+/+/ n 276
or you can ravel ( , ) an array before adding up:
+/,n 276