I can’t seem to remember how the notation specifies rows or columns.
I found though, a heuristic for it that works well, and it is simple.
Say we have the matrices:
X = [[1,2],[3,4],[5,6]]
Y = [[1],[3],[5]]
Z = [ [[4,2], [3,1], [4,45]], [[4,2], [3,1], [4,45]] ]
According to this method the dimensions [ ]
are:
[ X ] = 3 x 2
[ Y ] = 3 x 1
[ Z ] = 2 x 3 x 2
The steps are:
- Count the number of elements (L_1) at the lowest level
- Then the dimension is the number L_1
This step is repeated for each dimension, and you write it backwards, i.e
D = L_n, \dots, L_3, L_2, L_1
So for Z, the lowest level elements are arrays [a,b]
(that is the last number you specify).
- Also the number of commas + 1 will yield the right value.
The next level has 2 ,
so D is 3. We have 3 x 2 so far.
To my eyes it is easier to see the inner dimension first.
You can check it in python as:
>>> import numpy as np
>>> np.array(Z)
array([[[ 4, 2],
[ 3, 1],
[ 4, 45]],
[[ 4, 2],
[ 3, 1],
[ 4, 45]]])
>>> Z = np.array(Z)
>>> Z.shape
(2, 3, 2)