colour.utilities.tstack#

colour.utilities.tstack(a: ArrayLike, dtype: Type[DTypeBoolean] | Type[DTypeReal] | None = None) NDArray[source]#

Stack the specified array of arrays \(a\) along the last axis (tail) to produce a stacked array.

Used to stack an array of arrays produced by the colour.utilities.tsplit() definition.

Parameters:
Returns:

Stacked array.

Return type:

numpy.ndarray

Examples

>>> a = 0
>>> tstack([a, a, a])
array([0., 0., 0.])
>>> a = np.arange(0, 6)
>>> tstack([a, a, a])
array([[0., 0., 0.],
       [1., 1., 1.],
       [2., 2., 2.],
       [3., 3., 3.],
       [4., 4., 4.],
       [5., 5., 5.]])
>>> a = np.reshape(a, (1, 6))
>>> tstack([a, a, a])
array([[[0., 0., 0.],
        [1., 1., 1.],
        [2., 2., 2.],
        [3., 3., 3.],
        [4., 4., 4.],
        [5., 5., 5.]]])
>>> a = np.reshape(a, (1, 1, 6))
>>> tstack([a, a, a])
array([[[[0., 0., 0.],
         [1., 1., 1.],
         [2., 2., 2.],
         [3., 3., 3.],
         [4., 4., 4.],
         [5., 5., 5.]]]])