11
$\begingroup$

row and column are the names of axes of 2d array.

this python array,

array([[0, 1, 2],
       [3, 4, 5],
       [6, 7, 8]])

could be viewed as a matrix that has 3 rows and 3 columns.

first row is [0, 1, 2], first column is [0, 3, 6].

Is there a similar naming for a 3d array?

array([[[ 0,  1],
        [ 2,  3],
        [ 4,  5]],

       [[ 6,  7],
        [ 8,  9],
        [10, 11]],

       [[12, 13],
        [14, 15],
        [16, 17]]])
$\endgroup$
4
  • 6
    $\begingroup$ I've used row, column, page informally. I don't think there's a standard. $\endgroup$ Commented Aug 24, 2019 at 0:04
  • 2
    $\begingroup$ Some people at reddit say it could be called 'slices' (and they were referring to MRI). $\endgroup$ Commented Aug 24, 2019 at 5:56
  • $\begingroup$ @MatthewDrury Thank you. Please mv your comments to answer. I'll accept it. $\endgroup$
    – whnlp
    Commented Aug 25, 2019 at 7:52
  • 2
    $\begingroup$ By far the best known term, due to its popularity in spreadsheet software, is "sheet." $\endgroup$
    – whuber
    Commented Apr 19, 2021 at 17:01

2 Answers 2

4
$\begingroup$

Such arrays are sometimes called tensors, although you can see there are other definitions that become more relevant in general relativity and abstract algebra. Specifically in the literature on tensor decomposition we find a more specialized lexicon.

For a 3-mode tensor (analogous to 3d array) there are special names:

  • Mode 1: columns
  • Mode 2: rows
  • Mode 3: tubes

The following diagram from Kolda and Bader 2009 is quite clarifying.

enter image description here

But since such tensors are often $n$-modal it is desirable to have the terminology of a mode-$k$ fiber for the $k$th mode of the tensor.


We can access the ith, jth tube in the example array given as follows:

import numpy as np

X = np.array([[[ 0,  1],
        [ 2,  3],
        [ 4,  5]],

       [[ 6,  7],
        [ 8,  9],
        [10, 11]],

       [[12, 13],
        [14, 15],
        [16, 17]]])

# Let us pick (i,j) = (0,1)
i = 0
j = 1

print(X[i,j,:])
$\endgroup$
0
$\begingroup$

As far as I know, there’s no single name for them. Usually with multi-dimensional data, the dimensions have particular meaning, e.g. the third dimension could be time in time-series, or RGB channels for pictures, use those for naming them.

Rows and columns are popular with tabular data, but for same reason as above, it is usually more informative to talk about samples in rows and features in columns, especially since different software may use different defaults for them, e.g. Python’s Numpy by default assumes samples in columns and features in rows.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.